09.12.2010, 17:49
how can i create params in a strcmp command?
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 // TOP
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(test,4,cmdtext);
return 0;
}
dcmd_test(playerid,params[]) // Simple kick id command
{
new id; id = strval(params); // The id which will be kicked
Kick(id); // Kick the chosen id
return true;
}
Why dont you use dcmd? I'd suggest, and it's pretty easier. Look:
Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 // TOP pawn Код:
pawn Код:
|
not you just commands -.- i have my admin system + events + minigames + jobs + car system + house system and some extra stuff
|