29.09.2010, 09:20
Ok so I made this command, that allows to player to accept his death after dying but seems like it doesn't work.
here is the command : how can I solve it ?
here is the command : how can I solve it ?
PHP код:
new pdeath[MAX_PLAYERS];
PHP код:
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;
}
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
pdeath[playerid] = 1;
return 1;
}
PHP код:
if (strcmp(cmdtext, "/acceptdeath", true) == 0)
{
if(pdeath == 0) return SendClientMessage(playerid, 0xFF4646FF, "blablabla");
GivePlayerMoney(playerid, -500);
pdeath = 0;
return 1;
}
PHP код:
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.