new cmd[256], idx;cmd = strtok(cmdtext, idx);if(strcmp(cmd, \"/makeadmin\", true) == 0){ new string[128]; new tmp[256]; new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME]; new giveplayerid; if (IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, ORANGE, \"USAGE: /makeadmin [playerid] [level]\"); SendClientMessage(playerid, ORANGE, \"FUNCTION: Player will be an admin.\"); return 1; } giveplayerid = ReturnUser(tmp); tmp = strtok(cmdtext, idx); new level = strval(tmp); if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, player, sizeof(player)); PlayerInfo[giveplayerid][AdminLevel] = level; printf(\"Admin %s made %s a level %d admin.\", player, giveplayer, level); format(string, sizeof(string), \"You are now an administrator level %d thanks to %s.\", level, player); SendClientMessage(giveplayerid, 0x00C2ECFF, string); format(string, sizeof(string), \"You have given %s level %d admin.\", giveplayer,PlayerInfo[giveplayerid][AdminLevel]); SendClientMessage(playerid, 0x00C2ECFF, string); } else if(giveplayerid == INVALID_PLAYER_ID) { format(string, sizeof(string), \"%i is not an active player.\", giveplayerid); SendClientMessage(playerid, 0xE60000FF, string); } } else { SendClientMessage(playerid, 0xE60000FF, \"You are not a lead admin!\"); } return 1;}
C:\\Users\\Zsombi\\Desktop\\Szerver\\gamemodes\\rpg.pwn(1486) : warning 219: local variable \"tmp\" shadows a variable at a preceding levelC:\\Users\\Zsombi\\Desktop\\Szerver\\gamemodes\\rpg.pwn(1498) : error 017: undefined symbol \"ReturnUser\"Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 1 Error.
if(strcmp(cmd, \"/makeadmin\", true) == 0){ new string[128]; new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME]; new giveplayerid;giveplayerid = ReturnUser(tmp); new level = strval(tmp); if (IsPlayerAdmin(playerid)) { if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, \"Tipp: Használat: /makeadmin [playerid] [level]\"); return 1; } if(giveplayerid!= INVALID_PLAYER_ID){ GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, player, sizeof(player)); PlayerInfo[giveplayerid][Adminszint] = level; format(string, sizeof(string), \"You are now an administrator level %d thanks to %s.\", level, player); SendClientMessage(giveplayerid, 0x00C2ECFF, string); format(string, sizeof(string), \"You have given %s level %d admin.\", giveplayer,PlayerInfo[giveplayerid][Adminszint]); SendClientMessage(playerid, 0x00C2ECFF, string); }else if(giveplayerid == INVALID_PLAYER_ID) { format(string, sizeof(string), \"%i is not an active player.\", giveplayerid); SendClientMessage(playerid, 0xE60000FF, string); } } return 1;}
if(!strcmp(cmd, \"/makeadmin\", true)){ new string[128], player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME]; new giveplayerid = ReturnUser(tmp), level = strval(tmp); if (!IsPlayerAdmin(playerid)) return AendClientMessage(playerid, COLOR_WHITE, \" Nem vagy RCON admin!\"); if(!strlen(tmp) return SendClientMessage(playerid, COLOR_WHITE, \"Tipp: Használat: /makeadmin [playerid] [level]\");if(giveplayerid!= INVALID_PLAYER_ID){ GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, player, sizeof(player)); PlayerInfo[giveplayerid][Adminszint] = level; format(string, sizeof(string), \"You are now an administrator level %d thanks to %s.\", level, player); SendClientMessage(giveplayerid, 0x00C2ECFF, string); format(string, sizeof(string), \"You have given %s level %d admin.\", giveplayer,PlayerInfo[giveplayerid][Adminszint]); SendClientMessage(playerid, 0x00C2ECFF, string); } else if(giveplayerid == INVALID_PLAYER_ID) { format(string, sizeof(string), \"%i is not an active player.\", giveplayerid); SendClientMessage(playerid, 0xE60000FF, string); }return 1;}
if(!strcmp(cmd, \"/makeadmin\", true)){ new string[128], player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME]; new giveplayerid = ReturnUser(tmp), level = strval(tmp); if (!IsPlayerAdmin(playerid)) return AendClientMessage(playerid, COLOR_WHITE, \" Nem vagy RCON admin!\"); if(!strlen(tmp) return SendClientMessage(playerid, COLOR_WHITE, \"Tipp: Használat: /makeadmin [playerid] [level]\");if(IsPlayerConnected(giveplayerid)){ GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, player, sizeof(player)); PlayerInfo[giveplayerid][Adminszint] = level; format(string, sizeof(string), \"You are now an administrator level %d thanks to %s.\", level, player); SendClientMessage(giveplayerid, 0x00C2ECFF, string); format(string, sizeof(string), \"You have given %s level %d admin.\", giveplayer,PlayerInfo[giveplayerid][Adminszint]); SendClientMessage(playerid, 0x00C2ECFF, string); } else if(!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), \"%i is not an active player.\", giveplayerid); SendClientMessage(playerid, 0xE60000FF, string); }return 1;}
Holnap megírom sscanf használatával. Persze ha valaki meg nem eloz...