Why this CMD dont work ?
#1

This cmd just dont send msg and dont do the functions that i made.The server dont says unknown cmd....
PHP код:
CMD:sellmycar(playeridparams[])
{
    new 
string[128], playerb;
       if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
       if(!
IsPlayerNearPlayer(playeridplayerb2)) return SendClientMessage(playeridCOLOR_GREY"You are too far away from that player.");
    if(!
PlayerInfo[playerid][pVeh] && !PlayerInfo[playerid][pVVeh] && !PlayerInfo[playerid][pVVVeh]) return SendClientMessage(playeridCOLOR_GREY"You don't own a vehicle.");
    if(
sscanf(params"uis[64]"playerbcarslotcarprice)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /sellmycar [playerid] [slot] [price]");
    if(!
IsPlayerLoggedIn(playerb)) return SendClientMessage(playeridCOLOR_GREY"Invalid player id.");
    if(
playerid == playerb) return SendClientMessage(playeridCOLOR_GREY"You can't sell your car to yourself.");
    if(
carprice == 0) return SendClientMessage(playeridCOLOR_GREY"You cant sell your car for 0$.");
    if(
carslot || carslot 4) return SendClientMessage(playeridCOLOR_WHITE"There are only 4 car slots");
    switch(
carslot)
    {
        case 
1:
        {
            if(
PlayerInfo[playerid][vModel] == 0) return SendClientMessage(playeridCOLOR_GREY"You dont have vehicle in this slot.");
            new 
Float:vxFloat:vyFloat:vz;
            
GetVehiclePos(PlayerInfo[playerid][pVeh], vxvyvz);
            if(
IsPlayerInRangeOfPoint(playerid4vxvyvz)) return SendClientMessage(playeridCOLOR_GREY"You are not near your car.");
            
format(stringsizeof(string), " You have offered your %s to %s for $%d.",RVN(PlayerInfo[playerid][vModel]), RPN(playerb), carprice);
            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
            
format(stringsizeof(string), "%s has offered you his/her %s for $%d. (/accept car) (/cancel car)",RPN(playerid), RVN(PlayerInfo[playerid][vModel]), carprice);
            
SendClientMessage(playerbCOLOR_YELLOWstring);
            
CarBy[playerb] = playerid;
            
Car[playerb] = 0;
            
offeredcar[playerb] = 1;
        }
        case 
2:
        {
            if(
PlayerInfo[playerid][vVModel] == 0) return SendClientMessage(playeridCOLOR_GREY"You dont have vehicle in this slot.");
            new 
Float:vxFloat:vyFloat:vz;
            
GetVehiclePos(PlayerInfo[playerid][pVVeh], vxvyvz);
            if(
IsPlayerInRangeOfPoint(playerid4vxvyvz)) return SendClientMessage(playeridCOLOR_GREY"You are not near your car.");
            
format(stringsizeof(string), " You have offered your %s to %s for $%d.",RVN(PlayerInfo[playerid][vVModel]), RPN(playerb), carprice);
            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
            
format(stringsizeof(string), "%s has offered you his/her %s for $%d. (/accept car) (/cancel car)",RPN(playerid), RVN(PlayerInfo[playerid][vVModel]), carprice);
            
SendClientMessage(playerbCOLOR_YELLOWstring);
            
CarBy[playerb] = playerid;
            
Car[playerb] = 0;
            
offeredcar[playerb] = 2;
        }
        case 
3:
        {
            if(
PlayerInfo[playerid][vVVModel] == 0) return SendClientMessage(playeridCOLOR_GREY"You dont have vehicle in this slot.");
            new 
Float:vxFloat:vyFloat:vz;
            
GetVehiclePos(PlayerInfo[playerid][pVVVeh], vxvyvz);
            if(
IsPlayerInRangeOfPoint(playerid4vxvyvz)) return SendClientMessage(playeridCOLOR_GREY"You are not near your car.");
            
format(stringsizeof(string), " You have offered your %s to %s for $%d.",RVN(PlayerInfo[playerid][vVVModel]), RPN(playerb), carprice);
            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
            
format(stringsizeof(string), "%s has offered you his/her %s for $%d. (/accept car) (/cancel car)",RPN(playerid), RVN(PlayerInfo[playerid][vVVModel]), carprice);
            
SendClientMessage(playerbCOLOR_YELLOWstring);
            
CarBy[playerb] = playerid;
            
Car[playerb] = 0;
            
offeredcar[playerb] = 3;
        }
        case 
4:
        {
            if(
PlayerInfo[playerid][vVVVModel] == 0) return SendClientMessage(playeridCOLOR_GREY"You dont have vehicle in this slot.");
            new 
Float:vxFloat:vyFloat:vz;
            
GetVehiclePos(PlayerInfo[playerid][pVVVVeh], vxvyvz);
            if(
IsPlayerInRangeOfPoint(playerid4vxvyvz)) return SendClientMessage(playeridCOLOR_GREY"You are not near your car.");
            
format(stringsizeof(string), " You have offered your %s to %s for $%d.",RVN(PlayerInfo[playerid][vVVVModel]), RPN(playerb), carprice);
            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
            
format(stringsizeof(string), "%s has offered you his/her %s for $%d. (/accept car) (/cancel car)",RPN(playerid), RVN(PlayerInfo[playerid][vVVModel]), carprice);
            
SendClientMessage(playerbCOLOR_YELLOWstring);
            
CarBy[playerb] = playerid;
            
Car[playerb] = 0;
            
offeredcar[playerb] = 4;
        }
    }
     return 
1;

Reply


Messages In This Thread
Why this CMD dont work ? - by barts - 31.01.2014, 12:56
Re: Why this CMD dont work ? - by PowerPC603 - 31.01.2014, 15:24
Re: Why this CMD dont work ? - by barts - 01.02.2014, 07:53
Re: Why this CMD dont work ? - by Ryan McDuff - 01.02.2014, 07:59

Forum Jump:


Users browsing this thread: 1 Guest(s)