if(strcmp(cmd, "/fixveh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
SendClientMessage(playerid, COLOR_GREY, " Vehicle Fixed !");
}
}
return 1;
}
if(strcmp(cmd, "/fixveh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 3)
{
SendClientMessage(playerid, COLOR_GREY " you are not authorized to use that command!");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
SetVehicleHealth(GetVehicleid[playerid], 100.0);
SendClientMessage(playerid, COLOR_GREY, "Vehicle Fixed !");
}
}
return 1;
}
try this
PHP код:
|
GetPlayerName(playerid, sendername, sizeof(sendername));
What you did man? Removing this won't help:
pawn Код:
|
if(strcmp(cmdtext, "/fixveh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
SendClientMessage(playerid, COLOR_GREY, " Vehicle Fixed !");
}
}
return 1;
}
if(strcmp(cmd, "/fixveh", true) == 0)
{
new Float: soPos[3];
new vehicleID = GetPlayerVehicleID(playerid);
if(PlayerInfo[playerid][pAdmin] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
return 1;
}
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED, "You must be in a vehicle in order to use this command.");
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(IsVehicleOccupied(i))
{
GetVehiclePos(vehicleID, soPos[0], soPos[1], soPos[2]);
RepairVehicle(vehicleID);
SendClientMessage(playerid,COLOR_YELLOW,"Vehicle Repaired.");
return 1;
}
}
return 1;
}
i if(strcmp(cmd, "/fixveh", true) == 0) { if(AdminLevel[playerid] < 3) return SendClientMessage(playerid,0xFF0000AA,"You can't use this command."); if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_YELLOW,"You must be inside vehicle to use this command!"); if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, COLOR_YELLOW,"You do not have enough money to repair your vehicle!"); RepairVehicle(GetPlayerVehicleID(playerid)); SendClientMessage(playerid,0xFFFF00AA,"Server: Your Vehicle Has Been Repaired!"); GivePlayerMoney(playerid, -0); return 1; }
It's simple
PHP код:
|
GetVehiclePos(vehicleID, soPos[0], soPos[1], soPos[2]);
if(strcmp(cmd, "/fixveh", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] <=4) { SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fixveh [PlayerID/PartOfName]"); } new playa; playa = ReturnUser(tmp); if(IsPlayerInAnyVehicle(playa)) { new vid = GetPlayerVehicleID(playa); SetVehicleHealth(vid, 1000.0); RepairVehicle(GetPlayerVehicleID(playa)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* Admin %s has fixed your vehicle.", sendername); SendClientMessage(playa, COLOR_GREY, string); } else { format(string, sizeof(string),"I know you could fix cars, but since when can you fix players? %s isn't in a car. -Alex", PlayerName(giveplayerid)); SendClientMessage(playerid, COLOR_GREY, string); } return 1; } }