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;
}
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);
}
else
new derp = GetDistanceBetweenPlayers(playerid, id);
if(derp > 2)
{
SendClientMessage(playerid, COLOR_WHITE, "You are NOT near a player so you can't attemp to rape him.");
SetPVarInt(playerid,"RapeTime",GetTickCount()+10000);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Raped player.");
}
return 1;
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,playerid2)>2) return SendClientMessage(playerid, red, "You are NOT near something to attempt to rape");
if(GetDistanceBetweenPlayers(playerid,playerid2)<2)
{
SendClientMessage(playerid, COLOR_WHITE, "Raped player.");
SetPVarInt(playerid,"RapeTime",GetTickCount()+10000);
}
return 1;
}
pawn Код:
|
CMD:rape(playerid, params[])
{
new id;
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 are NOT near something to attempt to rape");
if(GetDistanceBetweenPlayers(playerid,id)<2)
{
SendClientMessage(playerid, COLOR_WHITE, "Raped player.");
SetPVarInt(playerid,"RapeTime",GetTickCount()+10000);
}
return 1;
}
try
pawn Код:
|
stock GetDistanceBetweenPlayers(playerid, id)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
GetPlayerPos(id,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);
}