A problem with Something - 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: A problem with Something (
/showthread.php?tid=511419)
A problem with Something -
gekas - 05.05.2014
Hello i have a problem with this.
PHP код:
dcmd_kill(playerid, params[])
{
#pragma unused params
if(TEAM_COP[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "Law Emergent Cant Use This Command");
}
SetPlayerHealth(playerid, 0);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has used command '/kill'.", pname);
SendClientMessageToAll(COLOR_MAROON, string);
}
return 1;
}
This is the line.
PHP код:
if(TEAM_COP[playerid] == 1)
And this is the problem
PHP код:
C:\Users\Arlind\Desktop\1v1 DeathMatch Server (V 1) - Copy\gamemodes\Dm.pwn(465) : error 029: invalid expression, assumed zero
C:\Users\Arlind\Desktop\1v1 DeathMatch Server (V 1) - Copy\gamemodes\Dm.pwn(465) : error 029: invalid expression, assumed zero
C:\Users\Arlind\Desktop\1v1 DeathMatch Server (V 1) - Copy\gamemodes\Dm.pwn(465) : warning 215: expression has no effect
C:\Users\Arlind\Desktop\1v1 DeathMatch Server (V 1) - Copy\gamemodes\Dm.pwn(465) : error 001: expected token: ";", but found "]"
C:\Users\Arlind\Desktop\1v1 DeathMatch Server (V 1) - Copy\gamemodes\Dm.pwn(465) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
Re: A problem with Something -
gekas - 05.05.2014
Can to help mee ?
Re: A problem with Something -
Eth - 05.05.2014
new gTeam[MAX_PLAYERS];
did you define it?
and
#define TEAM_COP 0
then:
pawn Код:
dcmd_kill(playerid, params[])
{
#pragma unused params
if(gTeam[playerid] == TEAM_COP)
{
SendClientMessage(playerid, COLOR_RED, "Law Emergent Cant Use This Command");
}
SetPlayerHealth(playerid, 0);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has used command '/kill'.", pname);
SendClientMessageToAll(COLOR_MAROON, string);
}
return 1;
}
Re: A problem with Something -
gekas - 05.05.2014
Dont Work