/givecash command help
#1

It gives me 49$ all time and when i use 2 digit numbers it shows player is not connected

Код:
CMD:givecash(playerid,params[])
{
	if(PInfo[playerid][Level] < 3)
        return SendClientMessage(playerid,STEALTH_BLUE,"You need to be level 3 to set someone's health.");
        new string[128],id,pCash,pName[MAX_PLAYER_NAME];
        if(sscanf(params,"us",id,pCash))
	return SendClientMessage(playerid,STEALTH_BLUE,"USAGE: /givecash [id] [amount]");
	if(!IsPlayerConnected(id))
	return SendClientMessage(playerid,STEALTH_BLUE,"That player is not connected!");
	GetPlayerName(playerid,pName,sizeof(pName));
	format(string,sizeof(string),"Administrator %s has sent you $%d server sided money.",pName,pCash);
	SendClientMessage(id,COLOR_DARKORCHID,string);
	GivePlayerMoney(id,pCash);
	return 1;
}
Reply
#2

PHP код:
if (sscanf (params"us"idpCash)) 
for
PHP код:
if (sscanf (params"ud"idpCash)) 
Reply
#3

thanks
Reply
#4

Also look at this,
https://github.com/Y-Less/sscanf/wiki

s is for strings.

I personally use i for numbers.
Reply
#5

Quote:
Originally Posted by The__
Посмотреть сообщение
Also look at this,
https://github.com/Y-Less/sscanf/wiki

s is for strings.

I personally use i for numbers.
his problem is already solved..
Reply
#6

Quote:
Originally Posted by Kursed
Посмотреть сообщение
his problem is already solved..
Obvious.. I was giving him the link for future reference. Genius.
Reply
#7

yes i noticed it,anyways ty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)