This thing confuses me..
#1

Hi, when i put this ProxDetector to the command, it wont show the "rp" text and it says Unknown Command
but the command is still working.. If i remove the proxtedector the command works, and it doesnt say unknown command. what is wrong?

This is the proxdetector
pawn Код:
format(string,sizeof(string),"%s and %s exchanges their vehicles.",RemoveUnderScore(playerid),RemoveUnderScore(playaid));
                ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

pawn Код:
else if(strcmp(x_job,"vehicle",true) == 0)
            {
                new buyername[MAX_PLAYER_NAME];
                if(TrySell[playerid][0]==SCRIPT_PLAYERS) {
                    SendClientMessage(playerid,COLOR_GRAD2,"No one has offered to sell you their car!");
                    return 1;
                }
                new cost=TrySell[playerid][1];
                GetPlayerName(playerid,playername,sizeof(playername));
                if(GetMoney(playerid)<cost) {
                    SendClientMessage(playerid,COLOR_GRAD2,"You don't even have enough cash!");
                    return 1;
                }
                playaid=TrySell[playerid][0];
                if(TrySell[playaid][0]!=playerid) {
                    SendClientMessage(playerid,COLOR_GRAD2,"This player is offline or not trying to sell to you!");
                    return 1;
                }
                if(PlayerInfo[playerid][pCarkey]==SCRIPT_CARS) {
                    PlayerInfo[playerid][pCarkey]=TrySell[playerid][2];
                } else if(PlayerInfo[playerid][pCarkey2]==SCRIPT_CARS) {
                    PlayerInfo[playerid][pCarkey2]=TrySell[playerid][2];
                } else if(PlayerInfo[playerid][pCarkey3]==SCRIPT_CARS) {
                    PlayerInfo[playerid][pCarkey3]=TrySell[playerid][2];
                } else if(PlayerInfo[playerid][pCarkey4]==SCRIPT_CARS) {
                    PlayerInfo[playerid][pCarkey4]=TrySell[playerid][2];
                } else if(PlayerInfo[playerid][pCarkey5]==SCRIPT_CARS) {
                    PlayerInfo[playerid][pCarkey5]=TrySell[playerid][2];
                } else {
                    SendClientMessage(playerid,COLOR_GRAD2,"You already have 5 vehicles.");
                    return 1;
                }
                GetPlayerName(VehicleOffer[playerid], giveplayer, sizeof(giveplayer));
                strcpy(CarInfo[TrySell[playerid][2]][cOwner],playername,MAX_PLAYER_NAME);
                KillPlayerCarKey(playaid,TrySell[playerid][2]);
                GiveMoney(playaid,cost);
                GiveMoney(playerid,-cost);
                format(string,sizeof(string),"%s sold their %s to %s for $%s.",RemoveUnderScore(playerid),vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400],RemoveUnderScore(playaid),Comma(cost));
                ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                TrySell[playerid][0]=SCRIPT_PLAYERS;
                TrySell[playaid][0]=SCRIPT_PLAYERS;
                format(tmp,sizeof(tmp),"%s sells his car to %s for $%i, Car ID %i",buyername,playername,cost,TrySell[playerid][2]); //buyername isn't the buyers name, its the sellers
                PayLog(tmp);
                VehicleOffer[playerid] = 999;
                VehiclePrice[playerid] = 0;
                UpdateAccount(playerid);
                SaveCars();
                return 1;
            }
Reply
#2

I will rep+
Reply
#3

PHP код:
else if(strcmp(cmdtext,"vehicle",true) == 0)
            {
                new 
buyername[MAX_PLAYER_NAME];
                if(
TrySell[playerid][0]==SCRIPT_PLAYERS) {
                    
SendClientMessage(playerid,COLOR_GRAD2,"No one has offered to sell you their car!");
                    return 
1;
                }
                new 
cost=TrySell[playerid][1];
                
GetPlayerName(playerid,playername,sizeof(playername));
                if(
GetMoney(playerid)<cost) {
                    
SendClientMessage(playerid,COLOR_GRAD2,"You don't even have enough cash!");
                    return 
1;
                }
                
playaid=TrySell[playerid][0];
                if(
TrySell[playaid][0]!=playerid) {
                    
SendClientMessage(playerid,COLOR_GRAD2,"This player is offline or not trying to sell to you!");
                    return 
1;
                }
                if(
PlayerInfo[playerid][pCarkey]==SCRIPT_CARS) {
                    
PlayerInfo[playerid][pCarkey]=TrySell[playerid][2];
                } else if(
PlayerInfo[playerid][pCarkey2]==SCRIPT_CARS) {
                    
PlayerInfo[playerid][pCarkey2]=TrySell[playerid][2];
                } else if(
PlayerInfo[playerid][pCarkey3]==SCRIPT_CARS) {
                    
PlayerInfo[playerid][pCarkey3]=TrySell[playerid][2];
                } else if(
PlayerInfo[playerid][pCarkey4]==SCRIPT_CARS) {
                    
PlayerInfo[playerid][pCarkey4]=TrySell[playerid][2];
                } else if(
PlayerInfo[playerid][pCarkey5]==SCRIPT_CARS) {
                    
PlayerInfo[playerid][pCarkey5]=TrySell[playerid][2];
                } else {
                    
SendClientMessage(playerid,COLOR_GRAD2,"You already have 5 vehicles.");
                    return 
1;
                }
                
GetPlayerName(VehicleOffer[playerid], giveplayersizeof(giveplayer));
                
strcpy(CarInfo[TrySell[playerid][2]][cOwner],playername,MAX_PLAYER_NAME);
                
KillPlayerCarKey(playaid,TrySell[playerid][2]);
                
GiveMoney(playaid,cost);
                
GiveMoney(playerid,-cost);
                
format(string,sizeof(string),"%s sold their %s to %s for $%s.",RemoveUnderScore(playerid),vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400],RemoveUnderScore(playaid),Comma(cost));
                
ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                
TrySell[playerid][0]=SCRIPT_PLAYERS;
                
TrySell[playaid][0]=SCRIPT_PLAYERS;
                
format(tmp,sizeof(tmp),"%s sells his car to %s for $%i, Car ID %i",buyername,playername,cost,TrySell[playerid][2]); //buyername isn't the buyers name, its the sellers
                
PayLog(tmp);
                
VehicleOffer[playerid] = 999;
                
VehiclePrice[playerid] = 0;
                
UpdateAccount(playerid);
                
SaveCars();
                return 
1;
            } 
Reply
#4

now your command will Work and it wont show unknown command
Код:
			else if(strcmp(x_job,"vehicle",true) == 0)
			{
				new buyername[MAX_PLAYER_NAME];
			    if(TrySell[playerid][0]==SCRIPT_PLAYERS) {
			        SendClientMessage(playerid,COLOR_GRAD2,"No one has offered to sell you their car!");
			    }
			    new cost=TrySell[playerid][1];
			    GetPlayerName(playerid,playername,sizeof(playername));
			    if(GetMoney(playerid)<cost) {
			        SendClientMessage(playerid,COLOR_GRAD2,"You don't even have enough cash!");
			    }
			    playaid=TrySell[playerid][0];
			    if(TrySell[playaid][0]!=playerid) {
					SendClientMessage(playerid,COLOR_GRAD2,"This player is offline or not trying to sell to you!");
			    }
			    if(PlayerInfo[playerid][pCarkey]==SCRIPT_CARS) {
					PlayerInfo[playerid][pCarkey]=TrySell[playerid][2];
			    } else if(PlayerInfo[playerid][pCarkey2]==SCRIPT_CARS) {
					PlayerInfo[playerid][pCarkey2]=TrySell[playerid][2];
			    } else if(PlayerInfo[playerid][pCarkey3]==SCRIPT_CARS) {
					PlayerInfo[playerid][pCarkey3]=TrySell[playerid][2];
			    } else if(PlayerInfo[playerid][pCarkey4]==SCRIPT_CARS) {
					PlayerInfo[playerid][pCarkey4]=TrySell[playerid][2];
			    } else if(PlayerInfo[playerid][pCarkey5]==SCRIPT_CARS) {
					PlayerInfo[playerid][pCarkey5]=TrySell[playerid][2];
			    } else {
			        SendClientMessage(playerid,COLOR_GRAD2,"You already have 5 vehicles.");
			    }
				GetPlayerName(VehicleOffer[playerid], giveplayer, sizeof(giveplayer));
				strcpy(CarInfo[TrySell[playerid][2]][cOwner],playername,MAX_PLAYER_NAME);
			    KillPlayerCarKey(playaid,TrySell[playerid][2]);
			    GiveMoney(playaid,cost);
			    GiveMoney(playerid,-cost);
				format(string,sizeof(string),"%s sold their %s to %s for $%s.",RemoveUnderScore(playerid),vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400],RemoveUnderScore(playaid),Comma(cost));
				ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			    TrySell[playerid][0]=SCRIPT_PLAYERS;
			    TrySell[playaid][0]=SCRIPT_PLAYERS;
			    format(tmp,sizeof(tmp),"%s sells his car to %s for $%i, Car ID %i",buyername,playername,cost,TrySell[playerid][2]); //buyername isn't the buyers name, its the sellers
			    PayLog(tmp);
			    VehicleOffer[playerid] = 999;
				VehiclePrice[playerid] = 0;
                UpdateAccount(playerid);
    	        SaveCars();
			    return 1;
			}
Reply
#5

Nope, it still says unknown command :O
Reply
#6

I'm pretty sure the problem is in the format line:
pawn Код:
format(string,sizeof(string),"%s sold their %s to %s for $%s.",RemoveUnderScore(playerid),vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400],RemoveUnderScore(playaid),Comma(cost));
See if the command works if you use the following instead:
pawn Код:
format(string, sizeof(string), "test");
Reply
#7

Yeah, its that line that is the problem, but how to fix it? it works with "test"
Reply
#8

Quote:
Originally Posted by MayaEU
Посмотреть сообщение
Yeah, its that line that is the problem, but how to fix it? it works with "test"
Debug...

pawn Код:
format(string,sizeof(string),"%s sold their %s to %s for $%s.",RemoveUnderScore(playerid),vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400],RemoveUnderScore(playaid),Comma(cost));
See which function causes the issue by trying out each one.

pawn Код:
format(string,sizeof(string),"%s sold their %s to %s for $%s.",RemoveUnderScore(playerid));
pawn Код:
format(string,sizeof(string),"%s sold their %s to %s for $%s.",vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
pawn Код:
And so on.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)