Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:changemyrunspeed(playerid)
- {
- new string[ 45 ], Float:vx, Float:vy, Float:vz, Float:speed;
- if(sscanf(params, "f", speed)) return SendClientMessage(playerid,-1, "/changemyrunspeed (value)");
- GetPlayerVelocity(playerid, vx, vy, vz);
- SetPlayerVelocity(playerid, vx * speed, vy * speed, vz * speed);
- format(string, sizeof(string), "Your Run Speed Is Currently: %.1f.", speed);
- SendClientMessage(playerid, -1, string);
- SetPVArInt(playerid, "Speed", speed);// this saves the speed
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- new speed = GetPVarInt(playerid, "Speed");// this gets the speed
- if(speed !=0)// this looks if the speed that he setted was not 0
- {// now set his velocity
- GetPlayerVelocity(playerid, vx, vy, vz);
- SetPlayerVelocity(playerid, vx * speed, vy * speed, vz * speed);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement