16.06.2012, 22:52
(
Последний раз редактировалось Gytis0; 27.06.2012 в 18:00.
)
So what I was trying to do, was create an /sms command by taking the /pm command from 'base' filterscript that you get when you download server files. In this command, I'm using a player variable for the phone number.
Here is the command:
Here is the strrest stock:
I was trying to make the command check if the player has the number typed in, he receives the message. Such as, if John's phone number is 3000, then he receives a message from James, whose number is 3500. Basically the command should work like "/sms 3000 Hey, what's up?". But now it doesn't work. When I type in both parameters it does nothing, just plain nothing, but if I miss both parameters, it gives two messages saying "Usage: /sms [number] [message]". So can anybody please help me? And please, don't tell me to switch to ZCMD, I already made like a million commands with the current format.
Here is the command:
pawn Код:
//Check out the latest post by me.
pawn Код:
stock strrest(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[128];
while ((index < length) && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}