SA-MP Forums Archive
Payticket to Payticket id? - 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: Payticket to Payticket id? (/showthread.php?tid=295212)



Payticket to Payticket id? - Admigo - 05.11.2011

Heey all,
How can i change my payticket command to payticket(id) so you can pay someone's ticket?
Code:
pawn Код:
dcmd_payticket(playerid,params[])
{
    #pragma unused params
    new string[128];
    if(IsSpawned[playerid] != 1)
    {
        SendClientMessage(playerid,COLOR_RED,"You must be alive and spawned in order to be able to use this command.");
        return 1;
    }
    if(IsKidnapped[playerid] == 1)
    {
        SendClientMessage(playerid,COLOR_RED,"You are kidnapped. You cannot use this command.");
        return 1;
    }
    if(HasTicket[playerid] != 1)
    {
        SendClientMessage(playerid,COLOR_RED,"You do not have a ticket to pay.");
        return 1;
    }
    SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_Ticket Paid_]]");
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have paid your ticket of $2000 and your wanted level has been removed.");
    SetPlayerWantedLevel(playerid,0);
    GivePlayerMoney(playerid,-2000);
    if(IsPlayerConnected(GetPVarInt(playerid, "copTicket")) && GetPVarType(playerid, "copTicket") != 0) {
        GivePlayerMoney(GetPVarInt(playerid, "copTicket"), 2000);
        DeletePVar(playerid, "copTicket");
    }

    HasTicket[playerid] =0;
    TimeToPayTicket[playerid] =0;

    format(string,sizeof(string),"[POLICE RADIO] Suspect %s(%d) has paid their ticket of $2000 and their wanted level has been removed.",PlayerName(playerid),playerid);
    SendClientMessageToAllCops(string);
    return 1;
}
Pls help me so i can make my server better.