22.08.2015, 15:53
PHP код:
CMD:rescue(playerid, params[])
{
if ((GetPlayerState(playerid) == PLAYER_STATE_WASTED) || GetPlayerState(playerid) == PLAYER_STATE_NONE) return 0;
if(GetPlayerTeam(playerid) == TEAM_TRUCKER)
{
new rand = random(sizeof(TruckerSpawn));
SetPlayerPos(playerid, TruckerSpawn[rand][SpawnX], TruckerSpawn[rand][SpawnY], TruckerSpawn[rand][SpawnZ]);
SetPlayerFacingAngle(playerid, TruckerSpawn[rand][SpawnAngle]);
}
if(GetPlayerTeam(playerid) == TEAM_COP)
{
new rand = random(sizeof(CopSpawn));
SetPlayerPos(playerid, CopSpawn[rand][SpawnX], CopSpawn[rand][SpawnY], CopSpawn[rand][SpawnZ]);
SetPlayerFacingAngle(playerid, CopSpawn[rand][SpawnAngle]);
}
SetPlayerVirtualWorld(playerid, 1);
Loadingmap(playerid);
SendClientMessage(playerid, COLOUR_YELLOW, "You been rescued!");
SetCameraBehindPlayer(playerid);
GivePlayerMoney(playerid, -300); // Add it work?
//PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - 300;
return 1;
}