08.10.2015, 13:48
PHP код:
if(strcmp(cmd, "/dropcar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerOnMission[playerid] > 0) return SendClientMessage(playerid, COLOR_GREY, " On a mission right now, can't use this command !");
if((GetPlayerState(playerid)) == 3) return SendClientMessage(playerid, COLOR_GREY, " Hey, this isn't your vehicle!");
if(PlayerInfo[playerid][pCarTime] > 60) // check if it's above 1 minute.
{
format(string, sizeof(string), "You already sold a car, you'll have to wait %d minutes before you can sell another.", SecondsToMinutes(PlayerInfo[playerid][pCarTime]));
SendClientMessage(playerid, COLOR_GREY, string);
}
else if(PlayerInfo[playerid][pCarTime] < 60 && PlayerInfo[playerid][pCarTime] > 0) // checks if it's below 1 minute but above 0 seconds.
{
format(string, sizeof(string), "You already sold a car, you'll have to wait %d seconds before you can sell another.", PlayerInfo[playerid][pCarTime]);
SendClientMessage(playerid, COLOR_GREY, string);
}
else // it can only be 0.
{
GameTextForPlayer(playerid, "~w~Car Selling ~n~~r~Drop the car at the Crane", 5000, 1);
CP[playerid] = 1;
SetPlayerCheckpoint(playerid, 2506.9529,-2629.9968,13.6465,8.0);
}
}
return 1;
}