13.06.2013, 14:55
How can i change this command to ZCMD? It's hard e.e
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp("/setmyspeed", cmd, true) == 0)
{
new tmp[128];
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,0xFF0000FF,"Usage: [num] [num] [num]");
return 1;
}
new s1=strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,0xFF0000FF,"Usage: [num] [num] [num]");
return 1;
}
new s2=strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,0xFF0000FF,"Usage: [num] [num] [num]");
return 1;
}
new s3=strval(tmp);
if(IsPlayerInAnyVehicle(playerid))
{
SetVehicleVelocity(GetPlayerVehicleID(playerid),s1,s2,s3);
}
else
{
SetPlayerVelocity(playerid,s1,s2,s3);
}
return 1;
}
return 0;
}