CMD:a( playerid, params[ ] )
{
if( ! strcmp( params, "weapon", true ) )
{
....................
}
else if( ! strcmp( params, "ban", true ) )
{
......................
}
else
{
SendClientMessage( playerid, COLOR, "/a [weapon/ban]" );
}
return true;
}
if(!strlen(params)) return SendClientMessage(playerid,COLOR_RED,"[Error]: Use /a[weapon/ban]");
CMD:a(playerid, params[])
{
new
var[16];
sscanf(params, "s[16] ", var);
if(!strcmp(var, "weapon", true))
{
new
id, weaponid, ammo;
if(sscanf(params[strlen(var)], "udd", id, weaponid, ammo)) return SendClientMessage(playerid, WHITE, "Use: /a weapon [id] [weaponid] [ammo]");
//if that doesn't work, try params[strlen(var) + 1]
}
else if(!strcmp(var, "ban", true))
{
}
else SendClientMessage(playerid, WHITE, "Use: /a [weapon/ban]");
return 1;
}
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;
}
Ok, I have problem with strcmp. So, for example:
I have command smth like this: /a weapon id gunid ammount And, everything is okay, just strcmp is fucked up. cmd example: pawn Код:
|
if( ! strcmp( "weapon id", "weapon", true ) )