Car spawner error.
#1

Hey,

Can someone help me whit this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
    if(!strlen(cmdtext[5]) return SendClientMessage(playerid, COLOR_RED, "Usage: /scar [Model ID]");
    new veh = strval(cmdtext[5]);
    if(veh < 400 || veh > 611) return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid Vehicle Model");
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x,y,z); GetPlayerFacingAngle(playerid, a);
    CreateVehicle(veh, x,y,z, a, -1, -1, -1);
    return 1;
    }
    return 0;
}
I have this error: error 001: expected token: ")", but found "return"

Thanks in advance!
Regards,
Jordyvc
Reply
#2

pawn Код:
if(!strlen(cmdtext[5]) return SendClientMessage(playerid, COLOR_RED, "Usage: /scar [Model ID]");
Needs a ) after the cmdtext[5])
pawn Код:
if(!strlen(cmdtext[5])) return SendClientMessage(playerid, COLOR_RED, "Usage: /scar [Model ID]");
Reply
#3

PHP код:
   if (strcmp("/mycommand"cmdtexttrue10) == 0)
    {
    new 
Float:xFloat:yFloat:zFloat:aveh strval(cmdtext[5]);
    if(!
strlen(cmdtext[5])) return SendClientMessage(playeridCOLOR_RED"Usage: /scar [Model ID]");
    if(
veh 400 || veh 611) return SendClientMessage(playeridCOLOR_RED"ERROR: Invalid Vehicle Model");
    
GetPlayerPos(playeridx,y,z); GetPlayerFacingAngle(playerida), CreateVehicle(vehx,y,za, -1, -1, -1);return 1;
    } 
Reply
#4

Thanks it's working!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)