10.02.2012, 22:31
pawn Код:
CMD:rape(playerid, params[])
{
if(gTeam[playerid] == TEAM_COP) return SendClientMessage(playerid, red, "Cops can't rape other players!");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"You can't rape a player if you are in a vehicle!");
if(IsSpawned[playerid] == 0) return SendClientMessage(playerid,0xFF0000FF,"You can't use this command when you are dead or spawning.");
if(GetPVarInt(playerid,"RapeTime")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"Please wait 10 seconds before rape again.");
if (GetDistanceBetweenPlayers(playerid, id)>2) return SendClientMessage(playerid, red, "You're too far away from that player.");
{
SendClientMessage(playerid, COLOR_WHITE, "Raped player.");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are NOT near a player so you can't attemp to rape him.");
SetPVarInt(playerid,"RapeTime",GetTickCount()+10000);
}
return 1;
}
pawn Код:
stock GetDistanceBetweenPlayers(playerid, playerid2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
GetPlayerPos(playerid2,x2,y2,z2);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
return floatround(tmpdis);
}
error 029: invalid expression, assumed zero
What's wrong?