19.08.2017, 22:30
Hello everyone there a are no problem but i want to add timer for ticket timer for someone payed it.
I'm adding this command to my server but there a problem. What is it? Read below..
I want add a ticket timer what i mean? : When i need to /tk [SOMEONE] Given him 25 secdons for payed if he not +4Stars on him how to do that?
I Want add /pay for payed the ticket money$$ how to do that?!
PHP код:
COMMAND:tk(playerid,params[])
{
new pId;
new pskin = GetPlayerSkin(playerid);
if(pskin == 265 || pskin == 266 || pskin == 267 || pskin == 280 || pskin == 281 || pskin == 284 || pskin == 285 || pskin == 286 || pskin == 287 || pskin == 288)
{
if(sscanf(params, "d", pId)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /tk [ID]");
else if(!IsPlayerConnected(pId)) return SendClientMessage(playerid, 0xFF0000AA, "[WARRING]:- The Player is not Connected/Invaild ID.");
else
{
new Float:x, Float:y, Float:z;
GetPlayerPos(pId, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 12.0, x, y, z))
{
new pname[MAX_PLAYER_NAME], aname[MAX_PLAYER_NAME], string1[250];
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(pId, aname, sizeof(aname));
if (GetPlayerWantedLevel(pId) == 0)
{
SendClientMessage(playerid, 0xFF0000AA, "{952C35}[WARRING]{FFFFFF}: This player is not wanted to ticket him.");
return 1;
}
else if (GetPlayerWantedLevel(pId) == 1 & 3)
{
SendClientMessage(pId, 0xFF0000AA, "[PAYED]:- The Player has been payed his ticket. [automacily].");
GivePlayerMoney(pId, -3500);
GameTextForPlayer(pId, "~b~Ticket Payed", 5000, 3);
GivePlayerMoney(playerid, 3500);
SendClientMessage(playerid, 0xFF0000AA, "[Getting]: You have got $3500, The player payed his ticket.");
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
SetPlayerWantedLevel(pId, 0);
SetPlayerColor(pId, COLOR_WHITE);
format(string1, sizeof(string1), "%s(%d) Has Recieved A Ticket From Officer {0080FF}%s(%d)", aname, pId, pname, playerid);
SendClientMessageToAll(0xFF0000AA, string1);
return 1;
}
else if (GetPlayerWantedLevel(pId) > 1)
{
SendClientMessage(playerid, 0xFF0000AA, "{952C35}[WARRING]{FFFFFF}: You can ticket this player type /ticket.");
return 1;
}
}
}
}
else
{
return SendClientMessage(playerid, 0xFF0000AA, "{FF0017}[ERROR]{FFFFFF}: Only Cops can use this command.");
}
return 1;
}
I want add a ticket timer what i mean? : When i need to /tk [SOMEONE] Given him 25 secdons for payed if he not +4Stars on him how to do that?
I Want add /pay for payed the ticket money$$ how to do that?!