Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Question

Posted

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!

6 answers to this question

Recommended Posts

Posted

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!");

Posted

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!

Posted

da dc asa?

if( sscanf ( etc. .... e pentru a vedea daca a scris toti parametrii, iar

if( GetPlayerMoney( etc. .... e pentru a vedea daca are suficienti bani.

Posted

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!

Guest RockStar
Posted

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.

Posted

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.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.