01.01.2012, 14:01
Thats not working too , but u gave me idea (+rep) , finally i got this working..
Btw , if someone else is searching for this heres code
Btw , if someone else is searching for this heres code
Код:
dcmd_rape(playerid,params[]) { new ID = GetClosestPlayerToPlayer(playerid); new string[128]; if(gTeam[playerid] != CIVILIAN) { SendClientMessage(playerid,COLOR_RED,"Only Civilians can rape other players."); return 1; } if(sscanf(params, "u", ID)) { ID=GetClosestPlayerToPlayer(playerid); if(GetDistanceBetweenPlayers(playerid,ID) > 8) { SendClientMessage(playerid,COLOR_RED,"No players around."); return 1; } if(HasRapedRecently[playerid] > 1) { SendClientMessage(playerid,COLOR_RED,"Please wait before raping someone again."); return 1; } } if(!IsPlayerConnected(ID)) { format(string,sizeof(string),"The player ID (%d) is not connected to the server.",ID); SendClientMessage(playerid,COLOR_RED,string); return 1; } if(GetDistanceBetweenPlayers(playerid,ID) > 4) { SendClientMessage(playerid,COLOR_RED,"That Player Is Not Close Enough"); return 1; } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) { SendClientMessage(playerid,COLOR_RED,"You cannot rape someone while in a vehicle. Exit the vehicle first."); return 1; } if(GetPlayerState(ID) == PLAYER_STATE_DRIVER || GetPlayerState(ID) == PLAYER_STATE_PASSENGER) { SendClientMessage(playerid,COLOR_RED,"You cannot rape someone while they are in a vehicle. Get them to exit the vehicle first."); return 1; } if(IsSpawned[ID] != 1) { format(string,sizeof(string),"%s(%d) is not spawned. You cannot rape dead people.",PlayerName(ID),ID); SendClientMessage(playerid,COLOR_RED,string); return 1; } if(HasRapedRecently[playerid] > 1) { SendClientMessage(playerid,COLOR_RED,"Please wait before raping someone again."); return 1; } new Float:phealth; GetPlayerHealth(ID,phealth); HasRapedRecently[playerid] =15; SetPlayerScore(playerid, GetPlayerScore(playerid)+1); SetPlayerHealth(ID, phealth-5); format(string,sizeof(string),"%s (%d) has raped %s (%d).",PlayerName(playerid),playerid,PlayerName(ID),ID); SendClientMessageToAll(COLOR_ORANGE,string); return 1; }