13.04.2012, 20:31
Код:
enum pInfo { pOperador } new PlayerInfo[MAX_PLAYERS][pInfo];
enum pInfo { pOperador } new PlayerInfo[MAX_PLAYERS][pInfo];
command(daroperador, playerid, params[])
{
new id, operador;
if(sscanf(params, "di", id, operador)) return SendClientMessage(playerid, -1, "/daroperador id operador");
if(!IsPlayerConnected(id) || id == -1) return SendClientMessage(playerid, -1, "Jogador invбlido");
PlayerInfo[id][pOperador] = operador;
SendClientMessage(id, "Lhe deram operador!");
SendClientMessage(id, "Vocк deu operador pro cara.!"); return 1;
}
if(!strcmp(cmd, "/daroperador", true)) {
if(!IsPlayerAdmin(playerid)) return 1;
tmp = strtok(cmdtext, idx);
new id = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "/daroperador id operador");
tmp = strtok(cmdtext, idx);
new op = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "/daroperador id operador");
PlayerInfo[id][pOperador] = op;
SendClientMessage(id, -1, "Te deram operador ");
SendClientMessage(playerid, -1, "Vc deu operador pro cara rsrrrs vida loka dorgas");
return 1;
}
error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1734) : error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1735) : error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1736) : error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1737) : error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1738) : error 017: undefined symbol "tmp"
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
if(!strcmp(cmd, "/daroperador", true))
{
new tmp[30];
if(!IsPlayerAdmin(playerid)) return 1;
tmp = strtok(cmdtext, idx);
new id = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "/daroperador id operador");
tmp = strtok(cmdtext, idx);
new op = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "/daroperador id operador");
PlayerInfo[id][pOperador] = op;
SendClientMessage(id, -1, "Te deram operador ");
SendClientMessage(playerid, -1, "Vc deu operador pro cara rsrrrs vida loka dorgas");
return 1;
}
C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1733) : error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1734) : error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1735) : error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1736) : error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1737) : error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1738) : error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(2032) : warning 202: number of arguments does not match definition C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(2506) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(2565) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(2566) : error 021: symbol already defined: "strtok" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 7 Errors.
Код:
error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1734) : error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1735) : error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1736) : error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1737) : error 017: undefined symbol "tmp" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1738) : error 017: undefined symbol "tmp" |
if(!strcmp(cmd, "/daroperador", true)) {
if(!IsPlayerAdmin(playerid)) return 1;
new tmp[128];
tmp = strtok(cmdtext, idx);
new id = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "/daroperador id operador");
tmp = strtok(cmdtext, idx);
new op = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "/daroperador id operador");
PlayerInfo[id][pOperador] = op;
SendClientMessage(id, -1, "Te deram operador ");
SendClientMessage(playerid, -1, "Vc deu operador pro cara rsrrrs vida loka dorgas");
return 1;
}