Error 017: undefined symbol "vehicle"
#1

I tried to add a new command to the script (zCMD)

This is the code i used.
Код:
CMD:aveh(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return 0;
    new type,color,color2,Float:cPos[4];
    if(sscanf(params, "iii", type,color,color2) return SendClientMessage(playerid,COLOR_RED, "/aveh [model] [color] [color]");
    if(type < 400 || type > 611) return SendClientMessage(playerid,COLOR_RED, "vehicle IDs between 400 - 611!");
    if(color> 255 || color< 0) return SendClientMessage(playerid, 0xFFFFFF, "Car color ID's: 0-255");
    if(color2> 255 || color2< 0) return SendClientMessage(playerid, 0xFFFFFF, "Car color ID's: 0-255");
    GetPlayerPos(playerid, cPos[0], cPos[1], cPos[2]);
    GetPlayerFacingAngle(playerid, cPos[3]);
    CreateVehicle(vehicle, cPos[0], cPos[1]-3, cPos[2], cPos[3], color, color2, -1);
    return 1;
}
So far so good, but when i try to compile it
It always gives me 1 error!

Error Code:

Код:
Error 017: undefined symbol "vehicle"
What did i do to solve this?
Deleted and re-installed all files.
Updates to the latest version
Tried to change "vehicle" and even tried to delete it,...
If i delete it and i go IG it says i spawned it and it says the command doesn't excist...

I hope anyone knows a solution for this...
Reply
#2

pawn Код:
CreateVehicle(modelid, x, y, z, angle, color1, color2, respawndelay);
It's supposed to be a modelid (https://sampwiki.blast.hk/wiki/Vehicle_Models)
Reply
#3

Change vehicle to type.
Reply
#4

Quote:
Originally Posted by Ken97
Посмотреть сообщение
pawn Код:
CreateVehicle(modelid, x, y, z, angle, color1, color2, respawndelay);
It's supposed to be a modelid (https://sampwiki.blast.hk/wiki/Vehicle_Models)
so the code should end with that? (Sorry im still learning... hope you dont mind me asking alot)
Reply
#5

Example:
pawn Код:
CreateVehicle(400, 0,0,0, 90, 0, 1, 60);
This creates a landstalker in a farm with colors, 0 and 1 and has a respawn time of 60 seconds
Reply
#6

Quote:
Originally Posted by Ken97
Посмотреть сообщение
Example:
pawn Код:
CreateVehicle(400, 0,0,0, 90, 0, 1, 60);
This creates a landstalker in a farm with colors, 0 and 1 and has a respawn time of 60 seconds
but thats in a farm (for example ofcourse)
but i want to get it like when you do /aveh that it spawns right next to me (Its not because im to lazy to find it...
i want more cars on the map thats all ghehe)

but if i just change the vehicle to modeid, would you think it would work?
Reply
#7

So basically, you want to spawn a certain vehicle in your place? If so:
pawn Код:
CMD:aveh(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return 0;
    new type,color,color2,Float:cPos[4];
    if(sscanf(params, "iii", type,color,color2) return SendClientMessage(playerid,COLOR_RED, "/aveh [model] [color] [color]");
    if(type < 400 || type > 611) return SendClientMessage(playerid,COLOR_RED, "vehicle IDs between 400 - 611!");
    if(color> 255 || color< 0) return SendClientMessage(playerid, 0xFFFFFF, "Car color ID's: 0-255");
    if(color2> 255 || color2< 0) return SendClientMessage(playerid, 0xFFFFFF, "Car color ID's: 0-255");
    GetPlayerPos(playerid, cPos[0], cPos[1], cPos[2]);
    GetPlayerFacingAngle(playerid, cPos[3]);
    CreateVehicle(type, cPos[0], cPos[1]-3, cPos[2], cPos[3], color, color2, -1);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)