pawn Код:
|
if(strcmp(cmd, "/spawn", true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You already have a Vehicle");
new String[200];
new tmp[256];
new Float:x, Float:y, Float:z;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, l_red, "You diden't give a vehicle name");
new vehicle = GetVehicleModelIDFromName(tmp);
if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, l_red, "That vehicle name was not found");
new Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
PutPlayerInVehicle(playerid, Veh[playerid], 0);
{
new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
}
format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
SendClientMessage(playerid, l_green, String);
return 1;
}
return 0;
}
i got this error
error 017: undefined symbol "vehicleid" at line PutPlayerInVehicle(playerid, vehicleid, 0); |
new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1); PutPlayerInVehicle(playerid, Veh[playerid], 0); LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
// PlayerConnect:
SetPVarInt(playerid, "vehicle", -1);
// Disconnect:
SetPVarInt(playerid, "vehicle", -1);
if(GetPVarInt(playerid, "vehicle") != -1) DestroyVehicle(GetPVarInt(playerid, "vehicle"));
// CommandText:
if(strcmp(cmd, "/spawn", true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You already have a Vehicle");
new String[200];
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, l_red, "You didn't give a vehicle name");
new vehicle = GetVehicleModelIDFromName(tmp);
if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, l_red, "That vehicle name was not found");
if(GetPVarInt(playerid, "vehicle") != -1) DestroyVehicle(GetPVarInt(playerid, "vehicle"));
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
SetPVarInt(playerid, "vehicle", CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1));
PutPlayerInVehicle(playerid, GetPVarInt(playerid, "vehicle"), 0);
LinkVehicleToInterior(GetPVarInt(playerid, "vehicle"), GetPlayerInterior(playerid));
format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
SendClientMessage(playerid, l_green, String);
return 1;
}