Jump to content
  • 0

Commands eror



Salut deci am si cateva erori la o commanda din Ladmin.

[pawn]dcmd_setsadmin(playerid,params[]) {

if(PlayerInfo[playerid][LoggedIn] == 1) {

if(PlayerInfo[playerid][Level] >= 12 || IsPlayerAdmin(playerid)) {

    new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);

    if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /setsadmin [playerid]");

    new player1,sadmin, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];

player1 = strval(tmp);

if(!strlen(tmp2)) return SendClientMessage(playerid, red, "USAGE: /setsadmin [playerid]"); sadmin = strval(tmp2);

if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {

if(PlayerInfo[player1][LoggedIn] == 1) {

if(sadmin > ServerInfo[MaxSAdminLevel] ) return SendClientMessage(playerid,red,"ERROR: Incorrect Sadmin Level");

if(sadmin == PlayerInfo[player1][sadmin]) return SendClientMessage(playerid,red,"ERROR: Player is already this Sadmin level");


GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));

      new year,month,day;  getdate(year, month, day); new hour,minute,second; gettime(hour,minute,second);

if(sadmin > 0) format(string,sizeof(string),"Administrator %s has set you to Sadmin Status [sadmin level %d]",adminname, sadmin);

else format(string,sizeof(string),"Administrator %s has set you to Player Status [sadmin level %d]",adminname, sadmin);


if(sadmin > PlayerInfo[player1][sadmin]) GameTextForPlayer(player1,"Promoted Sadmin", 2000, 3);

else GameTextForPlayer(player1,"Demoted Sadmin", 2000, 3);

format(string,sizeof(string),"You have made %s Sadmin Level %d on %d/%d/%d at %d:%d:%d", playername, sadmin, day, month, year, hour, minute, second); SendClientMessage(playerid,blue,string);

format(string,sizeof(string),"Administrator %s has made %s Sadmin Level %d on %d/%d/%d at %d:%d:%d",adminname, playername, sadmin, day, month, year, hour, minute, second);



PlayerInfo[player1][sadmin] = sadmin;

return PlayerPlaySound(player1,1057,0.0,0.0,0.0);

} else return SendClientMessage(playerid,red,"ERROR: Player must be registered and logged in to be sadmin");

} else return SendClientMessage(playerid, red, "Player is not connected");

} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");

} else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");


Acesta comanda ar trebui sa sete pe cine la gradu de Sadmin.

Uitati erorile si waringurile.

[pawn]:\Users\Ady\Desktop\rvip\ladmin4v2.pwn(4382) : warning 219: local variable "sadmin" shadows a variable at a preceding level

C:\Users\Ady\Desktop\rvip\ladmin4v2.pwn(4384) : error 022: must be lvalue (non-constant)

C:\Users\Ady\Desktop\rvip\ladmin4v2.pwn(4388) : warning 213: tag mismatch

C:\Users\Ady\Desktop\rvip\ladmin4v2.pwn(4389) : warning 213: tag mismatch

C:\Users\Ady\Desktop\rvip\ladmin4v2.pwn(4394) : warning 213: tag mismatch

C:\Users\Ady\Desktop\rvip\ladmin4v2.pwn(4394) : warning 206: redundant test: constant expression is non-zero

C:\Users\Ady\Desktop\rvip\ladmin4v2.pwn(4394) : warning 213: tag mismatch

C:\Users\Ady\Desktop\rvip\ladmin4v2.pwn(4395) : warning 213: tag mismatch

C:\Users\Ady\Desktop\rvip\ladmin4v2.pwn(4398) : warning 213: tag mismatch

C:\Users\Ady\Desktop\rvip\ladmin4v2.pwn(4401) : warning 213: tag mismatch

C:\Users\Ady\Desktop\rvip\ladmin4v2.pwn(4402) : warning 213: tag mismatch

C:\Users\Ady\Desktop\rvip\ladmin4v2.pwn(4404) : warning 213: tag mismatch

C:\Users\Ady\Desktop\rvip\ladmin4v2.pwn(4405) : warning 213: tag mismatch

C:\Users\Ady\Desktop\rvip\ladmin4v2.pwn(4382) : warning 203: symbol is never used: "sadmin"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Error.


Chiar nu pot sa-mi dau seama.

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.