AddStaticVehicle(411,2794.6809,1295.2672,10.4771,359.6819,64,1); // Spawn1 Infernus
AddStaticVehicle(411,1374.6643,2696.5872,10.5474,358.7312,112,1); // Spawn2 Infernus
AddStaticVehicle(520,1695.3934,1305.9945,10.5474,179.6371,64,1); // Spawn3 Hydra
mc_launch1 = AddStaticVehicle(595, 919.67877197266, -3045.7512207031, 0.71859455108643, 260.30029296875, 4, 33); //
mc_launch2 = AddStaticVehicle(595, 918.72479248047, -3051.8100585938, 0.84959363937378, 260.30029296875, 4, 33); //
if(!strcmp(cmdtext, "/spawnveh", true, 2))
{
if(!cmdtext[9])return SendClientMessage(playerid, COLOR_GREY, "USAGE: /spawnveh (Vehicle ID)");
if(PlayerInfo[playerid][AdminJailed] == 1)return SendClientMessage(playerid, COLOR_GREY, "You cannot use commands in Admin Jail.");
if(PlayerInfo[playerid][AdminLevel] > 2)
{
new
Float:ax, Float:ay, Float:az, Float:angle;
GetPlayerPos( playerid, ax, ay, az );
GetPlayerFacingAngle(playerid, angle);
CreateVehicle(cmdtext[10], ax+4, ay+4, az+1, angle, -1, -1, -1);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
}
}
|
Originally Posted by IcyBlight
'Ello!
First question: When I have following commands, /admins, /admin, /adminduty, /ann, /advert and all the other shit that start with a, how can I avoid the problem of some of them not working? Like /admins does "Announcement: ins"(/ann). |
|
Originally Posted by IcyBlight
Second question:
Why does these vehicles: pawn Код:
pawn Код:
|
|
Originally Posted by IcyBlight
Third question:
Why doesn't this work? I obviously messed up but anyway. Nothing appears when I use it. pawn Код:
|
if(!strcmp(cmdtext, "/spawnveh", true, 9)) //the number 9 here is for checking the first 9 characters on the command, so it will be triggered, when you type "/spawnveh"
{
if(PlayerInfo[playerid][AdminLevel] <= 2)
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
return 1;
}
if(!cmdtext[9])return SendClientMessage(playerid, COLOR_GREY, "USAGE: /spawnveh (Vehicle ID)");
if(PlayerInfo[playerid][AdminJailed] == 1)return SendClientMessage(playerid, COLOR_GREY, "You cannot use commands in Admin Jail.");
new vehid[4]; //because the vehicle model id has 3 characters
format(vehid, 4, "%s", cmdtext[10]); //getting the string which starts at index 10 and continues to where ever
new id = strval(vehid);
if (id < 400 || id > 612) //if It's an invalid model id
{
SendClientMessage(playerid, COLOR_GREY, "Invalid vehicle model ID");
return 1;
}
new
Float:ax, Float:ay, Float:az, Float:angle;
GetPlayerPos( playerid, ax, ay, az );
GetPlayerFacingAngle(playerid, angle);
CreateVehicle(id, ax+4, ay+4, az+1, angle, -1, -1, -1);
return 1;
}
if(vehid == mc_launch1 || mc_launch2)
{
if(PlayerInfo[playerid][Faction] != 6 && PlayerInfo[playerid][Faction] != 7 || PlayerInfo[playerid][Rank] < 2)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED , "[Faction Vehicle]: SA-Marines Launch - Rank 2+ only");
return 1;
}
}
if(vehid == mc_launch1 || vehid == mc_launch2)
|
Originally Posted by dice7
pawn Код:
|