Jump to content
  • 0

Question

Posted

Care ma ajuta sa fac comanda asta in ZCMD :)

NU imi iese :)))

CMD:lasercol(playerid,params[]) {
new tmp[256];
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) {
SendClientMessage(playerid, 0x00E800FF, "Usage: /lasercol [color]");
return 1;
}
if (!strcmp(tmp, "red", true)) SetPVarInt(playerid, "color", 18643);
else if (!strcmp(tmp, "blue", true)) SetPVarInt(playerid, "color", 19080);
else if (!strcmp(tmp, "pink", true)) SetPVarInt(playerid, "color", 19081);
else if (!strcmp(tmp, "orange", true)) SetPVarInt(playerid, "color", 19082);
else if (!strcmp(tmp, "green", true)) SetPVarInt(playerid, "color", 19083);
else if (!strcmp(tmp, "yellow", true)) SetPVarInt(playerid, "color", 19084);
else SendClientMessage(playerid, 0x00E800FF, "Colour not available!");
return 1;
}

468833_437698_362328_hiphop.jpg

1 answer to this question

Recommended Posts

Posted

Adik ce iti da errori sau vrei sa fie cu SScanf sau ce?

EDIT:

Uite incearca asa:

CMD:lasercol( playerid, params[ ] ) 
{
    if ( sscanf( params, "s[20]", params[ 0 ] ) ) return SendClientMessage( playerid, COLOR_RED, "USAGE: /lasercol [color]" );

if ( !strcmp( params[ 0 ] , "red", true ) ) SetPVarInt(playerid, "color", 18643 );
else if ( !strcmp( params[ 0 ] , "blue", true ) ) SetPVarInt(playerid, "color", 19080 );
else if ( !strcmp( params[ 0 ] , "pink", true ) ) SetPVarInt(playerid, "color", 19081 );
else if ( !strcmp( params[ 0 ] , "orange", true ) ) SetPVarInt(playerid, "color", 19082 );
else if ( !strcmp( params[ 0 ] , "green", true ) ) SetPVarInt(playerid, "color", 19083 );
else if ( !strcmp( params[ 0 ] , "yellow", true ) ) SetPVarInt(playerid, "color", 19084 );
else SendClientMessage( playerid, 0x00E800FF, "Colour not available! ");
return 1;
}

Fara reclama in semnatura!

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.