01.05.2015, 16:57
Hello,
I have this command
The problem is with the variable "prefix". It's integer, but I want to be string.
How to fix this?
I have this command
Код:
if(strcmp(cmd, "/setprefix", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "Usage: /setprefix [playerid] [Prefix text]"); return 1; } new para1; new prefix; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); prefix = strval(tmp); if (pInfo[playerid][Adminlevel] >= 6 || IsPlayerAdmin(playerid)) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "PREFIX: Administrator {FFFF00}%s {00FFFF} set you PREFIX {FFFF00}%s {00FFFF}. Congratulations!", PlayerName(playerid), prefix); SendClientMessage(para1, COLOR_ORANGE, string); pInfo[para1][Prefix] = prefix; format(string, sizeof(string), "PREFIX: {FFFF00}%s {00FFFF} now have PREFIX {FFFF00}%s{00FFFF}. Congratulations!", giveplayer, prefix); SendClientMessageToAll(COLOR_ORANGE, string); } } } else { SendClientMessage(playerid, COLOR_RED, "You have no access to this command!"); } } return 1; }
How to fix this?