/passcookie problems
#2

PHP код:
CMD:passcookie(playerid,params[])
{
    new 
string[128],PID,Playername[MAX_PLAYER_NAME];
    
GetPlayerName(PIDPlayernamesizeof(Playername));
    if(
PlayerInfo[playerid][pCookies] >=1)
    {
        if(
sscanf(params"d"PID)) return SendClientMessage(playerid,-1,"USAGE: /passcookie [playerid]");
        
format(stringsizeof(string), "* %s reaches into his pocket taking out a one big cookie passing it over to %s",RPName(playerid),RPNamePID ));
        
ProxDetector(20.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        
PlayerInfo[playerid][pCookies] --;
        
PlayerInfo[PID][pCookies] ++;
        }
    }
    else
    {
        
format(stringsizeof(string), "INFO:{3BB9FF} Sorry %s, Seams like you dont have any cookies"RPName(playerid));
        
SendClientMessage(playerid,-1,string);
    }
    return 
1;

samp chat line is maxed to 128 characters.
Also in the if-statement where your processing the user input your using a string (s) but you need an integer (i,d) you could also use the u parameter to find players
Reply


Messages In This Thread
/passcookie problems - by zT KiNgKoNg - 13.11.2012, 14:46
AW: /passcookie problems - by xerox8521 - 13.11.2012, 14:52
Re: /passcookie problems - by TheDeadlyDutchi - 13.11.2012, 14:53
AW: Re: /passcookie problems - by xerox8521 - 13.11.2012, 14:57
Re: /passcookie problems - by zT KiNgKoNg - 13.11.2012, 15:28
Re: /passcookie problems - by xMCx - 13.11.2012, 15:32

Forum Jump:


Users browsing this thread: 1 Guest(s)