some help with 2 commands.
#2

Fixed commands:

Код:
CMD:pay(playerid, params[]) 
{ 
    new id, amount, pName[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME], string[126]; 

    GetPlayerName(playerid, pName, sizeof(pName)); 
    GetPlayerName(id, pName2, sizeof(pName2)); 

    if(!sscanf(params, "ud", id, amount)) 
    { 
        if(id != playerid) 
        { 
            if(IsPlayerConnected(id)) 
            { 
                   if(Player[playerid][Money] >= amount) 
                   { 
                      Player[playerid][Money] -= amount; 
                      Player[id][Money] += amount; 
					  SetPlayerMoney(playerid, Player[playerid][Money]);
					  SetPlayerMoney(id, Player[id][Moneyg);

                    format(string, sizeof(string), "%s i-a dat lui %s $%d", pName, pName2, amount); 
                    ProxDetector(30, playerid, string, color_purple, color_purple, color_purple, color_purple, color_purple); 
                } else SendClientMessage(playerid, color_grey, "Nu ai destui bani !"); 
            } else SendClientMessage(playerid, color_grey, "Acest jucator nu este conectat !"); 
        } else SendClientMessage(playerid, color_grey, "Nu poti sa te platesti singur !"); 
    } 
    else SendClientMessage(playerid, color_grey, "UTILIZARE:/pay <id> <suma>"); 
    return 1; 
}
Код:
CMD:createcar(playerid, params[]) 
{ 
    if(IsPlayerInAnyVehicle(playerid)) 
    { 
        if(Player[playerid][Admin] >= 10) 
        { 
            new carid, color1, color2, Float:pos[4]; 

              GetPlayerPos(playerid, pos[0], pos[1], pos[2]); 
            GetPlayerFacingAngle(playerid, pos[3]); 
                
            if (!sscanf(params, "iii", carid, color1, color2)) 
            { 
				 new idofspawnedcar; 
                 idofspawnedcar = CreateVehicle(carid, pos[0], pos[1], pos[2], pos[3], color1, color2, -1); 
				 new engine, lights, alarm, doors, bonnet, boot, objective;
				 GetVehicleParamsEx(idofspawnedcar, engine, lights, alarm, doors, bonnet, boot, objective);
				 SetVehicleParamsEx(idofspawnedcar, 0, lights, alarm, doors, bonnet, boot, objective);
            } 
            else SendClientMessage(playerid, color_grey, "UTILIZARE: /createcar <modelid> <color1> <color2>"); 
        } 
        else SendClientMessage(playerid, 0xFF0000FF, "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)