SA-MP Forums Archive
Annoying problem! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Annoying problem! (/showthread.php?tid=591124)



Annoying problem! - Mikkel_RE - 08.10.2015

Hi, i have made that the dropcar timer will show in minutes and seconds, so when less than one minute it will start counting in seconds, but when the timer is done and type /dropcar Again, it still says You already sold a car, you'll have to wait 0 seconds before you can sell another, and then the dropcar checkpoint appears... i hope you gys can help me


pawn Код:
if(strcmp(cmd, "/dropcar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerOnMission[playerid] > 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   On a mission right now, can't use this command !");
                return 1;
            }
            if((GetPlayerState(playerid)) == 3){  
                SendClientMessage(playerid, COLOR_GREY, "   Hey, this isn't your vehicle!");
                return 1;
            }
            if(PlayerInfo[playerid][pCarTime] > 60)
            {
                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);
            }
            if(PlayerInfo[playerid][pCarTime] < 60 || PlayerInfo[playerid][pCarTime] > 0)
            {
                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);
            }
            if(PlayerInfo[playerid][pCarTime] == 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;
    }



Re: Annoying problem! - d3ll - 08.10.2015

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




Re: Annoying problem! - Mikkel_RE - 08.10.2015

Ohh, yeah ofc! thank you, REP+