Need help with spawn vehicle command!
#1

Script:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/car", cmdtext, true, 10) == 0)
{
new tmp[128];
tmp = strtok(cmdtext, idx);
new Float:posx, Float:posy, Float:posz;
GetPlayerPos(playerid, posx, posy, posz);
CreateVehicle(strval(tmp), posx, posy, posz, 0, random(126), random(126), 600);
return 1;
}
return 0;
}

Error:

....pwn(90) : error 017: undefined symbol "idx"
Reply
#2

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/car"cmdtexttrue10) == 0)
    {
        new 
tmp[128], idx;
        
tmp strtok(cmdtextidx);
        new 
Float:posxFloat:posyFloat:posz;
        
GetPlayerPos(playeridposxposyposz);
        
CreateVehicle(strval(tmp), posxposyposz0random(126), random(126), 600);
        return 
1;
    }
    return 
0;

Reply
#3

Maybe it's your style of scripting or something, but it's better if you switch to ZCMD.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)