24.01.2011, 14:07
But, I using strcmp in onplayertext and it works good, and in cmd not?..
I dont want to use another ways, I just wanna know whats wrong in my strcmp using;<>
pawn Код:
COMMAND:pinigai( playerid, params[ ] )
{
if( GetPVarInt( playerid, "Administratorius" ) < 3 ) return SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Zalia"Jыs neesate "#h_Geltona"Administratorius" );
if( !strcmp( params, "nuiimti", true ) )
{
new
ID,
Kiekis
;
if( sscanf( params, "ud", ID, Kiekis ) ) return SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Zalia"/pinigai nuiimti "#h_Geltona"<Vardas> <Kiekis>" );
if( ID == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Geltona"Юaidлjas yra "#h_Raudona"neprisijungжs" );
if( Kiekis > GetPlayerMoneyEx( playerid ) ) return SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Geltona"Kiekis suvestas "#h_Raudona"blogai" );
new
Stringas[ 160 ]
;
format( Stringas, 160, ""#h_Balta"[ > ] "#h_Geltona"Administratorius "#h_Zalia"%s "#h_Raudona"nuemл Jums pinigш. "#h_Orandzine"Kiekis: %d", ZaidejoVardas( playerid ), Kiekis );
SendClientMessage( ID, -1, Stringas );
GivePlayerMoneyEx( ID, - Kiekis );
}
if( !strcmp( params, "prideti", true ) )
{
new
ID,
Kiekis
;
if( sscanf( params, "ud", ID, Kiekis ) ) return SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Zalia"/pinigai prideti "#h_Geltona"<Vardas> <Kiekis>" );
else if( ID == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Geltona"Юaidлjas yra "#h_Raudona"neprisijungжs" );
new
Stringas[ 159 ]
;
format( Stringas, 159, ""#h_Balta"[ > ] "#h_Geltona"Administratorius "#h_Zalia"%s "#h_Raudona"davл Jums pinigш. "#h_Orandzine"Kiekis: %d", ZaidejoVardas( playerid ), Kiekis );
SendClientMessage( ID, -1, Stringas );
GivePlayerMoneyEx( ID, Kiekis );
}
else
{
SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Zalia"/pinigai "#h_Geltona"nuiimti/prideti" );
}
return true;
}