pinfo help - 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: pinfo help (
/showthread.php?tid=358536)
pinfo help -
Twinki1993 - 10.07.2012
okay I am first time working with pInfo.. can anyone help me?
I got this command
PHP код:
if(strcmp("/kick", cmdtext, true) == 0)
{
if(pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid, COLOR_RED, "<!>You are not TDM administrator!");
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/kick", true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_RED, "<!>Usage: /kick [playerid]");
Kick(strval(tmp));
return 1;
}
}
}
I get tons of errors for the first line there
PHP код:
D:\Igre\SAMP Serveri\0.3c\gamemodes\TDM.pwn(643) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
D:\Igre\SAMP Serveri\0.3c\gamemodes\TDM.pwn(643) : warning 215: expression has no effect
D:\Igre\SAMP Serveri\0.3c\gamemodes\TDM.pwn(643) : error 001: expected token: ";", but found "]"
D:\Igre\SAMP Serveri\0.3c\gamemodes\TDM.pwn(643) : error 029: invalid expression, assumed zero
D:\Igre\SAMP Serveri\0.3c\gamemodes\TDM.pwn(643) : fatal error 107: too many error messages on one line
This is my enum
PHP код:
enum pInfo
{
bool:SpawnDance,
Float:SpawnAngle,
SpawnTimer,
pAdminLevel,
pCash,
pScore
};
Re : pinfo help -
Ataraxia - 10.07.2012
pawn Код:
if(pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid, COLOR_RED, "<!>You are not TDM administrator!"); //ERROR LINE
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/kick", true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_RED, "<!>Usage: /kick [playerid]");
Kick(strval(tmp));
return 1;
}
}
Re: pinfo help -
Twinki1993 - 10.07.2012
same errors :P
Edit: RESOLVED
I re-defined pInfo with new again