new pdeath[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
SetPlayerColor(playerid, 0xFFFFFFAA);
SetPlayerMoney(playerid, 5000);
if(pdeath == 1)
{
TogglePlayerControllable(playerid, 0);
SetPlayerPos(playerid,1583.4307,-1634.7228,13.3905);
SendClientMessage(playerid, 0xFF4646FF, "/acceptdeath");
}
TogglePlayerControllable(playerid, 1);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
pdeath[playerid] = 1;
return 1;
}
if (strcmp(cmdtext, "/acceptdeath", true) == 0)
{
if(pdeath == 0) return SendClientMessage(playerid, 0xFF4646FF, "blablabla");
GivePlayerMoney(playerid, -500);
pdeath = 0;
return 1;
}
warnings :
C:\Documents and Settings\\My Documents\Downloads\samp03bsvr_R2_win32\gamemodes\RP.pwn(294) : error 033: array must be indexed (variable "pdeath")
C:\Documents and Settings\\My Documents\Downloads\samp03bsvr_R2_win32\gamemodes\RP.pwn(528) : error 033: array must be indexed (variable "pdeath")
C:\Documents and Settings\\My Documents\Downloads\samp03bsvr_R2_win32\gamemodes\RP.pwn(530) : error 033: array must be indexed (variable "pdeath")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
if (strcmp(cmdtext, "/acceptdeath", true) == 0)
{
if(pdeath == 0) return SendClientMessage(playerid, 0xFF4646FF, "blablabla");
GivePlayerMoney(playerid, -500);
pdeath = 0;
return 1;
}
pdeath = 0;
pdeath[playerid] = 0;
error 033: array must be indexed (variable "pdeath")
C:\Documents and Settings\\My Documents\Downloads\samp03bsvr_R2_win32\gamemodes\RP.pwn(528) : error 033: array must be indexed (variable "pdeath")
if (strcmp(cmdtext, "/acceptdeath", true) == 0) { if(pdeath[playerid] == 0) return SendClientMessage(playerid, 0xFF4646FF, "blablabla"); GivePlayerMoney(playerid, -500); pdeath[playerid] = 0; return 1; } |
public OnPlayerDeath(playerid, killerid, reason)
{
TogglePlayerControllable(playerid, 0);
pdeath[playerid] = 1;
SendClientMessage(playerid, 0xFF4646FF, "bbbbbdfgdfgdfg !");
SetPlayerPos(playerid,1583.4307,-1634.7228,13.3905);
return 1;
}
if (strcmp(cmdtext, "/acceptdeath", true) == 0)
{
if(pdeath[playerid] == 0) return SendClientMessage(playerid, 0xFF4646FF, "You are not dead.");
GivePlayerMoney(playerid, -500);
pdeath[playerid] = 0;
TogglePlayerControllable(playerid, 1);
return 1;
}
ApplyAnimation(playerid,"PED","BIKE_fallR",4.0,0,1,1,1,0); //Rolling over animation
ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0); // Going back to normal position in a smooth way.