how? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: how? (
/showthread.php?tid=197602)
how? -
.. - 09.12.2010
how can i create params in a strcmp command?
Re: how? -
blackwave - 09.12.2010
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 Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(test,4,cmdtext);
return 0;
}
pawn Код:
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;
}
Re: how? -
.. - 09.12.2010
Quote:
Originally Posted by blackwave
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 Код:
public OnPlayerCommandText(playerid, cmdtext[]) { dcmd(test,4,cmdtext); return 0; }
pawn Код:
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; }
|
i know about dcmd...
but i dont want to use it because its a slow processor. I dont want to use zcmd because it will ruin my work...
Re: how? -
Scenario - 09.12.2010
You would need to use strtok which is just bad news. It would be better to re-write your current commands using ZCMD and sscanf2.
Re: how? -
.. - 09.12.2010
Quote:
Originally Posted by RealCop228
You would need to use strtok which is just bad news. It would be better to re-write your current commands using ZCMD and sscanf2.
|
re-write 10142 lines? your mad xD
iv just being seeing the strtok with uses 250 value... thats too big -.-
Re: how? -
Mean - 09.12.2010
I don't know, use dcmd or zcmd
Re: how? -
Scenario - 09.12.2010
Quote:
Originally Posted by ..
re-write 10142 lines? your mad xD
iv just being seeing the strtok with uses 250 value... thats too big -.-
|
You don't need to re-write them, actually. You could use the current commands in combination with ZCMD and/or DCMD.
Re: how? -
Retardedwolf - 09.12.2010
10k lines of commands? Are you being serious to me?
Re: how? -
.. - 09.12.2010
Quote:
Originally Posted by Retardedwolf
10k lines of commands? Are you being serious to me?
|
not you just commands -.- i have my admin system + events + minigames + jobs + car system + house system and some extra stuff
Re: how? -
Scenario - 09.12.2010
Quote:
Originally Posted by ..
not you just commands -.- i have my admin system + events + minigames + jobs + car system + house system and some extra stuff
|
You don't need to re-write those systems just because of a change in command processors...
Quote:
Originally Posted by Retardedwolf
10k lines of commands? Are you being serious to me?
|
I know "The GodFather" was horribly scripted, but it has about 10k lines of commands - possibly more.