Нашёл тут фильтрскрипт на "давание транспорта", решил изменить его... Изменил, тока почему-то он "даёт" машину один раз, не понимаю почему, помогите пожалуйста
Code
#include <a_samp>
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if (strcmp(cmd,"/helicopter", true) == 0)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
CreateVehicle(447,x+0.2,y+0.2,z+0.2,0.0,1,1,1);
return 1;
}
if (strcmp(cmd,"/auto", true) == 0)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
CreateVehicle(535,x+0.2,y+0.2,z+0.2,0.0,1,1,1);
return 1;
}
if (strcmp(cmd,"/hydra", true) == 0)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
CreateVehicle(520,x+0.2,y+0.2,z+0.2,0.0,1,1,1);
return 1;
}
return 0;
}
+++Раздаю плюсы
+++
Добавлено (05.07.2008, 22:21)
---------------------------------------------
Quote (ATOM57)
"даёт" машину один раз
всмысле набираешь команду, а второй раз она не действует