#1

how can i create params in a strcmp command?
Reply
#2

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;
}
Reply
#3

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...
Reply
#4

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.
Reply
#5

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 -.-
Reply
#6

I don't know, use dcmd or zcmd
Reply
#7

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.
Reply
#8

10k lines of commands? Are you being serious to me?
Reply
#9

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
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)