PlayerInfo Fail :(
#1

Code:
CMD:givemoney(playerid, params[])
{
	new gpd, money;
	if(PlayerInfo[playerid][pAdmin] > 4 || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0x00FFFFFFFF, "You don't have enough permissions to use this command");
	{
	    if(sscanf(params, "ri", gpd, money)) return SendClientMessage(playerid, 0x00FFFFFFFF, "SYNTAX: /givemoney (player id) (value)");
	    {
		   GivePlayerMoney(gpd, money);
		   new name[MAX_PLAYERS];
		   new name2[MAX_PLAYERS];
		   new string[128];
		   new string2[129];
		   format(string, sizeof(string), "Admin %s Has Given You Money %i", GetPlayerName(playerid, name, sizeof(name)), money);
		   SendClientMessage(gpd,0x00FFFFFFFF, string);
		   format(string2, sizeof(string2), "You Have Given %s %i Money", GetPlayerName(gpd, name2, sizeof(name2)), money);
		   SendClientMessage(playerid,0x00FFFFFFFF, string2);
		}
	}
	return 1;
}
I Have These code, but when i type it /givemoney, it just says i don't have permissions on Return SendClientMessage, but when i checked my PlayerInfo, it has 4(which means working fine)
please help me someone
Reply
#2

Logical mistake
PHP Code:
PlayerInfo[playerid][pAdmin] > 
Reply
#3

Overall mistake
PHP Code:
    if(PlayerInfo[playerid][pAdmin] > || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid0x00FFFFFFFF"You don't have enough permissions to use this command");
    { 
Why are u opening braces after returning a conditional statement
Reply
#4

so, how do it get fixed?
Reply
#5

Quote:
Originally Posted by MiyuUchiha
View Post
so, how do it get fixed?
By reading the replies again.
Reply
#6

ah ok, thx, btw GhostHacker9, you was little clucker, now you are big clucker :/ :v
Reply
#7

+Rep Both Of You
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)