COMMAND:vc(playerid, params[])
{
if(spawnn[playerid] == 0) return 1;
if(!adminLevel(playerid, 1))
return 0;
new tempCar[10], vsID, message[128];
if(sscanf(params, "s[10]", tempCar))
{
Usage(playerid, "vc(reate) <vehicle name>");
}
else
{
new Float:x, Float:y, Float:z, Float:a;
vsID = getVehicleModelFromName(tempCar);
if(vsID < 400 || vsID > 612)
{
Server(playerid, "Unknown vehicle name.");
}
else
{
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
if(vsID == 612)
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
}
else
{
for(new i = 0; i < MAX_ADMIN_VEHICLES; i++)
{
if(!GM[adminV][i])
{
GM[adminV][i] = CreateVehicle(vsID, x, y, z, a, random(255), random(255), 600000);
LinkVehicleToInterior(GM[adminV][i], GetPlayerInterior(playerid));
SetVehicleVirtualWorld(GM[adminV][i], GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, GM[adminV][i], 0);
format(message, sizeof(message), "You have spawned a "CHAT_YELLOW"%s"CHAT_WHITE".", vehicleNames[vsID - 400]);
Server(playerid, message);
break;
}
if(i == (MAX_ADMIN_VEHICLES - 1))
{
Server(playerid, "Too many admin vehicle has been respawned, type "CHAT_YELLOW"/respawnallav "CHAT_WHITE"to respawn all admin vehicle.");
}
}
}
}
}
return 1;
}
Hold up, that's not what this section is for at all.
You can hire, or ask someone to do work for you in the "Looking for scripters/helpers" thread. This is for if you have a problem with your code, not that you want someone to script things for you. |
I Need Help For Complet My Script! This Forum For Scripting Help! Go And Read Rules!
Any One Can Fix It? |
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
DestroyVehicle(currentveh);
COMMAND:vc(playerid, params[])
{
if(spawnn[playerid] == 0) return 1;
if(!adminLevel(playerid, 1))
return 0;
new tempCar[10], vsID, message[128];
if(sscanf(params, "s[10]", tempCar))
{
Usage(playerid, "vc(reate) <vehicle name>");
}
else
{
new Float:x, Float:y, Float:z, Float:a;
vsID = getVehicleModelFromName(tempCar);
if(vsID < 400 || vsID > 612)
{
Server(playerid, "Unknown vehicle name.");
}
else
{
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
if(vsID == 612)
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
}
else
{
for(new i = 0; i < MAX_ADMIN_VEHICLES; i++)
{
if(!GM[adminV][i])
{
new currentveh; //<<<<<Not Work Good!
currentveh = GetPlayerVehicleID(playerid); //<<<<<Not Work Good!
DestroyVehicle(currentveh); //<<<<<Not Work Good!
GM[adminV][i] = CreateVehicle(vsID, x, y, z, a, random(255), random(255), 600000);
LinkVehicleToInterior(GM[adminV][i], GetPlayerInterior(playerid));
SetVehicleVirtualWorld(GM[adminV][i], GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, GM[adminV][i], 0);
format(message, sizeof(message), "You have spawned a "CHAT_YELLOW"%s"CHAT_WHITE".", vehicleNames[vsID - 400]);
Server(playerid, message);
break;
}
if(i == (MAX_ADMIN_VEHICLES - 1))
{
Server(playerid, "Too many admin vehicle has been respawned, type "CHAT_YELLOW"/respawnallav "CHAT_WHITE"to respawn all admin vehicle.");
}
}
}
}
}
return 1;
}
if(currentvehicle)
{
DestroyVehicle(currentvehicle);
}
//new currentveh; <<<<<Not Work Good! because you shouldn't do this...
//currentveh = GetPlayerVehicleID(playerid); //<<<<<Not Work Good!
if(currentvehicle[playerid])
{
DestroyVehicle(currentvehicle[playerid]);
}
//DestroyVehicle(currentveh); //<<<<<Not Work Good!
new currentvehicle[MAX_PLAYERS];
error 033: array must be indexed (variable "currentvehicle") error 035: argument type mismatch (argument 1)
for(new i = 0; i < MAX_ADMIN_VEHICLES; i++)
{
if(!GM[adminV][i])
{
new currentvehicle[MAX_PLAYERS];
if(currentvehicle)
{
DestroyVehicle(currentvehicle);
}
GM[adminV][i] = CreateVehicle(vsID, x, y, z, a, random(255), random(255), 600000);
LinkVehicleToInterior(GM[adminV][i], GetPlayerInterior(playerid));
SetVehicleVirtualWorld(GM[adminV][i], GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, GM[adminV][i], 0);
format(message, sizeof(message), "You have spawned a "CHAT_YELLOW"%s"CHAT_WHITE".", vehicleNames[vsID - 400]);
Server(playerid, message);
break;
}