if(strcmp(cmd, "/daradmin", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Vocк nгo tem permissгo.");
new playera = ReturnUser(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid,-1,"Use: /daradmin [ID/Nome do player] [Nivel].");
if(!IsPlayerConnected(playera)) return SendClientMessage(playerid,-1,"ERRO: Player nгo conectado.");
tmp = strtok(cmdtext, idx);
new nivel = strval(tmp);
if(!strval(tmp)) return SendClientMessage(playerid,-1,"Use: /daradmin [ID/Nome do player] [Nivel].");
if(nivel == 1 || nivel == 2 || nivel == 3 || nivel == 100 || nivel == 1000)
{
PlayerInfo[playera][pAdmin] = nivel;
new playeraname[MAX_PLAYER_NAME],string[50];
GetPlayerName(playera,playeraname,sizeof(playeraname));
format(string,sizeof(string),"Vocк deu admin nivel %d para %s", nivel, playeraname);
SendClientMessage(playerid,-1,string);
format(string,sizeof(string),"Vocк ganhou admin nivel %d de %s",nivel,PlayerName(playerid));
SendClientMessage(playera,-1,string);
}
else { SendClientMessage(playerid,-1,"Os nнveis sгo: 1, 2, 3, 100 e 1000(Admin Dono)"); }
return 1;
}
Bom, comeзei meu GM do 0, eu criei um enum pInfo. Nele coloquei pLevel, pSex e pAdmin.
Agora quero fazer um comando para tipo, alguйm digitar /daradmin [id] [level] mudar o level (pAdmin) para o que eu quizer! Nгo sei se й assim mesmo que faz essas coisas de admin. Irei agredecer quem me ajudar. Abraзos! |
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(189) : error 017: undefined symbol "cmd"
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(191) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(191) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(193) : error 017: undefined symbol "ReturnUser"
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(194) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(196) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(196) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(197) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(198) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(201) : error 017: undefined symbol "PlayerInfo"
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(201) : warning 215: expression has no effect
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(201) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(201) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(201) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
13 Errors.
pawn Код:
|
new cmd[156],tmp[156],idx;
cmd = strtok(cmdtext, idx);
stock 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;
}
enum pInfo
{
tambemnaosei
};
new Naoseioque[MAX_PLAYERS][pInfo];
PlayerInfo[playera][pAdmin] = nivel;
//=========== POR
Naoseioque[playera][pAdmin] = nivel;
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(195) : error 017: undefined symbol "ReturnUser"
C:\Documents and Settings\Beatriz\Desktop\SA-MP\gamemodes\vinewood.pwn(208) : error 017: undefined symbol "PlayerName"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.