06.06.2010, 13:58
Tried yours, got like 4 errors...
Here is an example code, for teleporting to a player. Maybe this could help you guys figure out the code for admin commands?
Код:
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(830) : warning 217: loose indentation \GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(832) : error 017: undefined symbol "pAdminLvl" \GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(832) : warning 215: expression has no effect \GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(832) : error 001: expected token: ";", but found "]" \GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(832) : error 029: invalid expression, assumed zero \GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(832) : fatal error 107: too many error messages on one line
Код:
if(strcmp(cmd, "/adgoto", true) == 0) // Teleports to a player { new Float:pX,Float:pY,Float:pZ; if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, ORANGE, "USAGE: /adgoto [playername/id]"); SendClientMessage(playerid, ORANGE, "FUNCTION: Will teleport to the specified player."); return 1; } new giveplayerid = ReturnUser(tmp); if(giveplayerid != INVALID_PLAYER_ID) { if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { GetPlayerPos(giveplayerid,pX,pY,pZ); SetVehiclePos(GetPlayerVehicleID(playerid),pX,pY,pZ+2); } else { GetPlayerPos(giveplayerid,pX,pY,pZ); SetPlayerPos(playerid,pX,pY,pZ+2); } SetPlayerInterior(playerid,GetPlayerInterior(giveplayerid)); } else if(giveplayerid == INVALID_PLAYER_ID) { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, RED, string); } } else SendClientMessage(playerid, RED, "You are not an admin with the required level."); return 1; }