[Tutorial] An In-Depth philosophy to creating a SA-MP Server.
#2

new message[256];
so much string space for such a message?


new Float: X, Float: Y, Float: Z;
GetPlayerPos(playerid, X, Y, Z);
new Float: velocityX, Float: velocityY, Float: velocityZ;
new Float: vehiclevX, Float: vehiclevY, Float: vehiclevZ;
GetVehicleVelocity(GetPlayerVehicleID(i), vehiclevX, vehiclevY, vehiclevZ);
GetPlayerVelocity(playerid, X, Y, Z);
if(!IsPlayerInAnyVehicle(i)) {
new Float: speed = (( velocityX*velocityX ) + (velocityY * velocityY) + (velocityZ*velocityZ));
if(speed > 100) {
if(!IsPlayerAdmin(playerid)) OnPlayerCheating(i);
}
}
else {
new speed = ( (vehiclevX*vehiclevX) + (vehiclevY*vehiclevY) + (vehiclevZ*vehiclevZ) );
if(speed > 100) {
if(!IsPlayerAdmin(playerid)) OnPlayerCheating(i);
}
}

wtf is this code?
Reply


Messages In This Thread
An In-Depth philosophy to creating a SA-MP Server. - by XStormiest - 12.05.2020, 20:15
Re: An In-Depth philosophy to creating a SA-MP Server. - by l0gic - 12.05.2020, 20:58
Re: An In-Depth philosophy to creating a SA-MP Server. - by XStormiest - 12.05.2020, 21:04

Forum Jump:


Users browsing this thread: 1 Guest(s)