CMD:jetpack(playerid, params[])
{
SetPlayerSpecialAction(playerid, 2);
if(IsPlayerAdmin(playerid)) SendClientMessage(0xDEEE20FF, "Jetpack Spawned");
else SendClientMessage(0xDEEE20FF, "You are not an admin.");
return 1;
}
C:\Users\Zach\Desktop\Critical Stunting\gamemodes\new.pwn(248) : error 035: argument type mismatch (argument 2)
C:\Users\Zach\Desktop\Critical Stunting\gamemodes\new.pwn(249) : error 035: argument type mismatch (argument 2)
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
|
try this:
Код:
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK); |
CMD:jetpack(playerid)
{
if(IsPlayerAdmin(playerid))
{
SetPlayerSpecialAction(playerid, 2);
SendClientMessage(playerid, 0xDEEE20FF, "Jetpack Spawned");
}
else SendClientMessage(playerid, 0xDEEE20FF, "You are not an admin.");
return 1;
}
|
I have another question, how can I simply make a /car command to spawn one certain vehicle ID at my location. I can't find a function for that.
|
CMD:spawncar(playerid, params[]) {
if (PlayerInfo[playerid][pAdmin] >= 4) {
new
iVehicle,
iColors[2];
if(sscanf(params, "iii", iVehicle, iColors[0], iColors[1])) {
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /veh [model ID] [color 1] [color 2]");
}
else if(!(400 <= iVehicle <= 611)) {
SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid model specified (model IDs start at 400, and end at 611).");
}
else if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255)) {
SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid colour specified (IDs start at 0, and end at 255).");
}
else for(new iIterator; iIterator < sizeof(CreatedCars); iIterator++) if(CreatedCars[iIterator] == INVALID_VEHICLE_ID) {
new
Float: fVehPos[4];
GetPlayerPos(playerid, fVehPos[0], fVehPos[1], fVehPos[2]);
GetPlayerFacingAngle(playerid, fVehPos[3]);
CreatedCars[iIterator] = CreateVehicle(iVehicle, fVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
VehicleFuel[CreatedCars[iIterator]] = 100.0;
LinkVehicleToInterior(CreatedCars[iIterator], GetPlayerInterior(playerid));
return SendClientMessageEx(playerid, COLOR_GREY, "Vehicle spawned!");
}
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
return 1;
}
CMD:destroycar(playerid, params[])
{
new string[128];
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
return 1;
}
new bool:breakingloop = false, newid = INVALID_VEHICLE_ID;
if(IsPlayerInAnyVehicle(playerid))
{
for(new i=0;i<sizeof(CreatedCars);i++)
{
if(!breakingloop)
{
if(CreatedCars[i] == GetPlayerVehicleID(playerid)) // Checking for next available ID.
{
breakingloop = true;
newid = i;
}
}
}
if(newid != INVALID_VEHICLE_ID)
{
new carid = GetPlayerVehicleID(playerid);
DestroyVehicle(carid);
CreatedCars[newid] = INVALID_VEHICLE_ID;
format(string, sizeof(string), " Car %d destroyed.", carid);
SendClientMessageEx(playerid, COLOR_GREY, string);
}
}
return 1;
}