[HELP] On player death. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] On player death. (
/showthread.php?tid=318775)
[HELP] On player death. -
Stefand - 16.02.2012
Hello, i'm making an Cops Vs Criminals script.
but if an Cop die i wanna set him back to Civilian thats working, but i want him send a message to be cop again.
this are my script things
pawn Код:
#define team_lspd 1 // team to design lspd officers
#define team_civ 2 // team to design civilians
#define team_criminal 3 //team to design criminals
new pTeam[MAX_PLAYERS];
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason); // Shows the kill in the killfeed/deathlog/death window
if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
{
pScore[killerid]++;
SetPlayerScore(killerid, pScore[killerid]);
pCash[killerid] += 100;
GivePlayerMoney(killerid, 100);
}
// Outside the check, handle stuff for playerid
// if killerid was INVALID_PLAYER_ID the player killed themselves (i.e. falling)
pDeaths[playerid]++;
pCash[playerid] -= 100;
pScore[playerid]--;
SetPlayerScore(playerid, pScore[playerid]);
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, pCash[playerid]);
return 1;
}
if(pTeam[playerid] = team_lspd);
{
SendClientMessage(playerid, COLOR_WHITE, "You're now back a Civilian, type /cop to be back a cop!");
return 1;
}
Can someone help me ;d
Greetz
Re: [HELP] On player death. -
Stefand - 17.02.2012
why nobody helps me!?