14.03.2015, 05:05
Hi there, i need help whit this command:
And I get these errors:
I found this code on the forum and I wanted to adapt it to my GameMode help please, regards!!
PHP код:
new bool:Jailed[MAX_PLAYERS];
PHP код:
dcmd_jail(playerid, params[])
{
new jailedid, time, string[128];
if(sscanf(params, "ud", jailedid, time))
{
SendClientMessage(playerid, -1, "/jail <id> <minutes>");
}
else if(jailedid == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not online.");
}
else if(Jailed[jailedid] == true)
{
SendClientMessage(playerid, COLOR_RED, "ERROR: Player already jailed.");
}
else
{
SetTimerEx("Unjailtime", 1000 * time, false, "d", jailedid);
format(string, sizeof(string), "%d is jailed", jailedid);
SendClientMessage(playerid, COLOR_RED, string);
SendClientMessage(jailedid, COLOR_RED, "You have been jailed!");
}
return 1;
}
PHP код:
public Unjailtime(playerid)
{
Jailed = false;
SendClientMessage(jailedid, COLOR_GREEN, "You're free!");
SetPlayerPos(jailedid, 1676.9254, 1448.6653, 10.7831);
return 1;
}
Код:
(10143) : warning 235: public function lacks forward declaration (symbol "Unjailtime") (10145) : error 033: array must be indexed (variable "Jailed") (10146) : error 017: undefined symbol "jailedid" (10147) : error 017: undefined symbol "jailedid"