Problem with command
#1

Hello,
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;
	}
The problem is with the variable "prefix". It's integer, but I want to be string.
How to fix this?
Reply


Messages In This Thread
Problem with command - by bobsona - 01.05.2015, 16:57
Re: Problem with command - by Evocator - 01.05.2015, 17:34
Re: Problem with command - by bobsona - 01.05.2015, 17:57
Re: Problem with command - by Mencent - 01.05.2015, 18:57
Re: Problem with command - by bobsona - 01.05.2015, 19:07
Re: Problem with command - by bobsona - 02.05.2015, 11:32
Re: Problem with command - by arlindi - 02.05.2015, 14:03
Re: Problem with command - by bobsona - 02.05.2015, 18:28

Forum Jump:


Users browsing this thread: 1 Guest(s)