Jump to content
  • 0

intrebare sscanf2...


xxSPEEDYxx

Question

Sall

Am o intrebare despre sscanf...

deci dau un ex...este o functie asemanatoare:

if(GetPlayerMoney(playerid) >= CarInfo[i][cValue])
						{
	}
						else
						{
							SendClientMessage(playerid, GREY, "   You don't have the cash for that!");
							return 1;
						}
si as vrea sa pun asa:
if(sscanf(params, "ud", GetPlayerMoney(playerid) >= CarInfo[i][cValue])) return SendClientMessage(playerid, GREY, "   You don't have the cash for that!");

daca se poate??

Fara reclama in semnatura!

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Nu poti pune

if(sscanf(params, "ud", GetPlayerMoney(playerid) >= CarInfo[i][cValue])) return SendClientMessage(playerid, GREY, "   You don't have the cash for that!");
dar in schimb poti pune
if( sscanf( params, "ud", params[ 0 ], params[ 1 ] ) ) return SendClientMessage(playerid, GREY, "USAGE: < /comanda [parametrii] >");
if( GetPlayerMoney(playerid) >= CarInfo[i][cValue] ) ) return SendClientMessage(playerid, GREY, "   You don't have the cash for that!");

Link to comment
Share on other sites

stuntman-=!!" post="79634" timestamp="1308929231"]

Nu poti pune

if(sscanf(params, "ud", GetPlayerMoney(playerid) >= CarInfo[i][cValue])) return SendClientMessage(playerid, GREY, "   You don't have the cash for that!");
dar in schimb poti pune
if( sscanf( params, "ud", params[ 0 ], params[ 1 ] ) ) return SendClientMessage(playerid, GREY, "USAGE: < /comanda [parametrii] >");
if( GetPlayerMoney(playerid) >= CarInfo[i][cValue] ) ) return SendClientMessage(playerid, GREY, "   You don't have the cash for that!");

da dc asa?

Fara reclama in semnatura!

Link to comment
Share on other sites

ca sa nu mai fac alt topic cu sscanf...postez in asta:

am o alta intrebare daca se poate pune asa in sscanf sa verifice o variabila de ex:

if( sscanf(params, "ud", InEvent[playerid] == 1 )) return SendClientMessage(playerid,0xFFFFFFAA,"You can not use jetpack at the event!");

?

Fara reclama in semnatura!

Link to comment
Share on other sites

Guest RockStar

if( sscanf(params, "ud", InEvent[playerid] == 1 )) return SendClientMessage(playerid,0xFFFFFFAA,"You can not use jetpack at the event!");

Codu ala nu are niciun inteles..."ud" semnifica: u = playerid, d = string si...."InEvent[playerid] == 1"....????

Si nu cred ca se poate.

Link to comment
Share on other sites

sscanf e folosit doar pentru a pune usage, si pentru a formata un string, sau asa ceva, params sa devina params[ 0 ], params[ 1 ], etc., sa se faca string, numar, nu sa verifice toate porcariile.

Pentru aia pui asa:

if( sscanf( params, "ud", params[ 0 ], params[ 1 ] ) ) return SendClientMessage(playerid,0xFFFFFFAA,"USAGE: < /comanda [parametrii]");
if( InEvent[ playerid ] == 1 ) return SendClientMessage(playerid,0xFFFFFFAA,"You can not use jetpack at the event!"); 

EDIT: Rock, d = decimal = cifra.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.