some help with 2 commands.
#1

hi there, I have a problem with my /pay command and with the /createcar .

The problem with the /pay is that It doesn't give the money to the playerid, on the action it says that it gives the money to urself and the money doesn't +/-

PHP код:
CMD:pay(playeridparams[])
{
    new 
idamountpName[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME], string[126];
    
GetPlayerName(playeridpNamesizeof(pName));
    
GetPlayerName(idpName2sizeof(pName2));
    if(!
sscanf(params"ud"idamount))
    {
        if(
playerid == playerid)
        {
            if(
IsPlayerConnected(id))
            {
                   if(
Player[playerid][Money] >= amount)
                   {
                      
Player[playerid][Money] -= amount;
                      
Player[id][Money] += amount;
                    
format(stringsizeof(string), "%s i-a dat lui %s $%d"pNamepName2amount);
                    
ProxDetector(30playeridstringcolor_purplecolor_purplecolor_purplecolor_purplecolor_purple);
                } else 
SendClientMessage(playeridcolor_grey"Nu ai destui bani !");
            } else 
SendClientMessage(playeridcolor_grey"Acest jucator nu este conectat !");
        } else 
SendClientMessage(playeridcolor_grey"Nu poti sa te platesti singur !");
    }
    else 
SendClientMessage(playeridcolor_grey"UTILIZARE:/pay <id> <suma>");
    return 
1;

And with the /createcar . How can I make it when the car is spawned to have its engine off ? I tried for a bit of time but it doesn't spawn the car .

PHP код:
CMD:createcar(playeridparams[])
{
    if(
IsPlayerInAnyVehicle(playerid))
    {
        if(
Player[playerid][Admin] >= 10)
        {
            new 
caridcolor1color2Float:pos[4];
              
GetPlayerPos(playeridpos[0], pos[1], pos[2]);
            
GetPlayerFacingAngle(playeridpos[3]);
               
            if (!
sscanf(params"iii"caridcolor1color2))
            {
                 
CreateVehicle(caridpos[0], pos[1], pos[2], pos[3], color1color2, -1);
              }
            else 
SendClientMessage(playeridcolor_grey"UTILIZARE: /createcar <modelid> <color1> <color2>");
        }
        else 
SendClientMessage(playerid0xFF0000FF"Nu esti autorizat sa foloseste aceasta comanda.");
    }
    return 
1;

Reply


Messages In This Thread
some help with 2 commands. - by SpikeSpigel - 30.10.2015, 17:24
Re: some help with 2 commands. - by feartonyb - 30.10.2015, 17:34

Forum Jump:


Users browsing this thread: 1 Guest(s)