01.06.2011, 08:12
I need /v command for spawn vehicle, with id inputted in parameters, but if the player create the first two cars disappear and the second to stay
CMD:veh(playerid, params[]) { new vehid; if(sscanf(params, "i", vehid)) SendClientMessage(playerid, COLOR_GREY, "SYNTAX: /veh <carid>"); else if (vehid < 400 || vehid > 611) SendClientMessage(playerid, COLOR_GREY, "[ERROR] Invalid car id! [ Car ID's range from 400 - 611 ]"); else { if(vCar[playerid] != -1) { DestroyVehicle(vCar[playerid]); } new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); vCar[playerid] = CreateVehicle(vehid, x + 3, y, z, 0, 0,0, -1); SendClientMessage(playerid, COLOR_GREEN, "Car spawned at your location!"); } return 1; }
error:
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(34) : error 017: undefined symbol "playerid" line 34: new vCar[playerid]=-1; |