28.11.2012, 16:58
Hi, i have a timer on my /dropcar command and i want it to show this when your dropcar cooldown timer isnt reloaded, "You already sold a car, you'll have to wait %d minutes before you can sell another!" But when i type the command in-game nothing shows, please help.
Here's the code:
Here's the code:
pawn Код:
if(strcmp(cmd, "/dropcar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
//if(PlayerInfo[playerid][pJob] == 5)
//{
if(PlayerOnMission[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " On a mission right now, can't use this command !");
return 1;
}
if((GetPlayerState(playerid)) == 3){ //checks if passenger
SendClientMessage(playerid, COLOR_GREY, " Hey, this isn't your vehicle!"); // sends error
return 1;
}
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);
}
else //
{
new timeLeft3;
new skillPoints = PlayerInfo[playerid][pJackSkill];
if(UsedDrop[playerid] != 0 && skillPoints < 400)
{
if(skillPoints >= 0 && skillPoints < 50)
{
timeLeft3 = 1200 - UsedDrop[playerid];
}
if(skillPoints >= 50 && skillPoints < 100)
{
timeLeft3 = 1080 - UsedDrop[playerid];
}
if(skillPoints >= 100 && skillPoints < 200)
{
timeLeft3 = 960 - UsedDrop[playerid];
}
if(skillPoints >= 200 && skillPoints < 400)
{
timeLeft3 = 840 - UsedDrop[playerid];
}
if(skillPoints >= 400)
{
timeLeft3 = 720 - UsedDrop[playerid];
}
format(string, sizeof(string), "You already sold a car, you'll have to wait %d seconds before you can sell another!", timeLeft3);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
}
//}
//else
//{
// SendClientMessage(playerid, COLOR_GREY, " You are not a Car Jacker !");
//}
}//not connected
return 1;
}