30.12.2014, 17:44
(
Последний раз редактировалось AlirezaG; 31.12.2014 в 06:25.
)
hi
i want write script for hitman's and FBI's Member to can change their phone number , level and name
but i have get errors
i use this code:
and i have this error in other line:
i want write script for hitman's and FBI's Member to can change their phone number , level and name
but i have get errors
Код:
gamemodes\UG-RP.pwn(84343) : error 014: invalid statement; not in switch gamemodes\UG-RP.pwn(84343) : error 029: invalid expression, assumed zero gamemodes\UG-RP.pwn(84350) : error 017: undefined symbol "logstring"
Код:
if(strcmp(cmd, "/pstat", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setstat [statcode] [amount]"); SendClientMessage(playerid, COLOR_GRAD1, "|1 Level |2 Phonenumber |3 Name"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setstat [statcode] [amount]"); SendClientMessage(playerid, COLOR_GRAD1, "|1 Level |2 Phonenumber |3 Name"); return 1; } new stat; stat = strvalEx(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setstat [statcode] [amount]"); SendClientMessage(playerid, COLOR_GRAD1, "|1 Level |2 Phonenumber |3 Name"); return 1; } new amount; new logstring[128]; new year, month, day; getdate(year, month, day); GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); amount = strvalEx(tmp); switch (stat) { case 1: { PlayerInfo[giveplayerid][pLevel] = amount; format(string, sizeof(string), " That players Level was set to %d", amount); format(logstring, sizeof(logstring), "[%d/%d/%d] %s has set %s's Level to %d", day, month, year, sendername, giveplayer, amount); } case 2: { PlayerInfo[giveplayerid][pPnumber] = amount; format(string, sizeof(string), " That players Phone Number was set to %d", amount); format(logstring, sizeof(logstring), "[%d/%d/%d] %s has set %s's Phone Number to %d", day, month, year, sendername, giveplayer, amount); } case 3: { GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); // PlayerInfo[giveplayerid][pDisabled] = 1; // OnPlayerSave(giveplayerid); SetPlayerName(giveplayerid, tmp); // PlayerInfo[giveplayerid][pDisabled] = 0; OnPlayerSave(giveplayerid); // save player (in case server has a restart and fucks up their name) format(string, sizeof(string), " You have renamed %s to %s !", giveplayer, tmp); SendClientMessage(playerid, COLOR_GREY, string); format(string, sizeof(string), "Your name has been changed from %s to %s.", giveplayer, tmp); SendClientMessage(giveplayerid, COLOR_YELLOW, string); format(string, sizeof(string), "%s has renamed %s to %s.", sendername, giveplayer, tmp); return 1; } } default: // line 84343 , error line { format(string, sizeof(string), " Invalid stat code %d !", amount); return 1; } } SendClientMessage(playerid, COLOR_GRAD1, string); StatLog(logstring); } } } return 1; }
and i have this error in other line:
Код:
gamemodes\UG-RP.pwn(124464) : warning 204: symbol is assigned a value that is never used: "query"
Код:
new query[128], field[256], DBResult:result; result = db_query(MailDB, "SELECT * FROM `Letters`"); // line 124464 if (db_num_rows(result) != 0) {