This command fucks my script
#1

This is my /accept taxi, When I remove the "/*" and "*/" my whole compiler is spammed with errors and warnings

Code:
Код:
if(!strcmp(params, "taxi", true))
	{
	    new playerb;
	    if(!IsATaxidriver(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not a Taxi driver.");
	    if(AcceptedTaxi[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You have already accepted a taxi call.");
	    if(sscanf(params, "s[128]i", params, playerb)) return SendClientMessage(playerid, COLOR_GREY, "/accept taxi [ID]");
	    if(!IsPlayerLoggedIn(playerb) && !IsPlayerNPC(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
	    if(OrderedTaxi[playerb] == 1)
		{
			format(string, sizeof(string), "You have accepted %s's Taxi call, He is now marked on your radar", RPN(playerb));
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "Taxi Driver %s is now on his way to you", RPN(playerid));
			SendClientMessage(playerb, COLOR_YELLOW, string);
			CP[playerid] = 8779;
			AcceptedTaxi[playerid] = 1;
			new Float:PosX, Float:PosY, Float:PosZ;
			GetPlayerPos(playerb, PosX, PosY, PosZ);
			SetPlayerCheckpoint(playerid, PosX, PosY, PosZ, 4.0);
			return 1;				}
		}
		else if(OrderedTaxi[playerb] == 0)
		{
		    SendClientMessage(playerid, COLOR_GREY, "This player hasn't ordered a Taxi");
		    return 1;
		}
	}*/
Reply
#2

How about posting the errors?
Reply
#3

Код:
if(!strcmp(params, "taxi", true))
	{
	    new playerb;
	    if(!IsATaxidriver(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not a Taxi driver.");
	    if(AcceptedTaxi[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You have already accepted a taxi call.");
	    if(sscanf(params, "s[128]i", params, playerb)) return SendClientMessage(playerid, COLOR_GREY, "/accept taxi [ID]");
	    if(!IsPlayerLoggedIn(playerb) && !IsPlayerNPC(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
	    if(OrderedTaxi[playerb] == 1)
		{
			format(string, sizeof(string), "You have accepted %s's Taxi call, He is now marked on your radar", RPN(playerb));
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "Taxi Driver %s is now on his way to you", RPN(playerid));
			SendClientMessage(playerb, COLOR_YELLOW, string);
			CP[playerid] = 8779;
			AcceptedTaxi[playerid] = 1;
			new Float:PosX, Float:PosY, Float:PosZ;
			GetPlayerPos(playerb, PosX, PosY, PosZ);
			SetPlayerCheckpoint(playerid, PosX, PosY, PosZ, 4.0);
			return 1;				}    <---- what is this doing here?
		}
		else if(OrderedTaxi[playerb] == 0)
		{
		    SendClientMessage(playerid, COLOR_GREY, "This player hasn't ordered a Taxi");
		    return 1;
		}
	}*/
Reply
#4

try this

PHP код:
if(!strcmp(params"taxi"true))
    {
        new 
playerb;
        if(!
IsATaxidriver(playerid)) return SendClientMessage(playeridCOLOR_WHITE"You are not a Taxi driver.");
        if(
AcceptedTaxi[playerid] == 1) return SendClientMessage(playeridCOLOR_GREY"You have already accepted a taxi call.");
        if(
sscanf(params"s[128]i"paramsplayerb)) return SendClientMessage(playeridCOLOR_GREY"/accept taxi [ID]");
        if(!
IsPlayerLoggedIn(playerb) && !IsPlayerNPC(playerb)) return SendClientMessage(playeridCOLOR_GREY"Invalid player id.");
        if(
OrderedTaxi[playerb] == 1)
        {
            
format(stringsizeof(string), "You have accepted %s's Taxi call, He is now marked on your radar"RPN(playerb));
            
SendClientMessage(playeridCOLOR_YELLOWstring);
            
format(stringsizeof(string), "Taxi Driver %s is now on his way to you"RPN(playerid));
            
SendClientMessage(playerbCOLOR_YELLOWstring);
            
CP[playerid] = 8779;
            
AcceptedTaxi[playerid] = 1;
            new 
Float:PosXFloat:PosYFloat:PosZ;
            
GetPlayerPos(playerbPosXPosYPosZ);
            
SetPlayerCheckpoint(playeridPosXPosYPosZ4.0);
            return 
1;
        }
        else if(
OrderedTaxi[playerb] == 0)
        {
            
SendClientMessage(playeridCOLOR_GREY"This player hasn't ordered a Taxi");
            return 
1;
        }
    }*/ 
Reply
#5

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
try this

PHP код:
if(!strcmp(params"taxi"true))
    {
        new 
playerb;
        if(!
IsATaxidriver(playerid)) return SendClientMessage(playeridCOLOR_WHITE"You are not a Taxi driver.");
        if(
AcceptedTaxi[playerid] == 1) return SendClientMessage(playeridCOLOR_GREY"You have already accepted a taxi call.");
        if(
sscanf(params"s[128]i"paramsplayerb)) return SendClientMessage(playeridCOLOR_GREY"/accept taxi [ID]");
        if(!
IsPlayerLoggedIn(playerb) && !IsPlayerNPC(playerb)) return SendClientMessage(playeridCOLOR_GREY"Invalid player id.");
        if(
OrderedTaxi[playerb] == 1)
        {
            
format(stringsizeof(string), "You have accepted %s's Taxi call, He is now marked on your radar"RPN(playerb));
            
SendClientMessage(playeridCOLOR_YELLOWstring);
            
format(stringsizeof(string), "Taxi Driver %s is now on his way to you"RPN(playerid));
            
SendClientMessage(playerbCOLOR_YELLOWstring);
            
CP[playerid] = 8779;
            
AcceptedTaxi[playerid] = 1;
            new 
Float:PosXFloat:PosYFloat:PosZ;
            
GetPlayerPos(playerbPosXPosYPosZ);
            
SetPlayerCheckpoint(playeridPosXPosYPosZ4.0);
            return 
1;
        }
        else if(
OrderedTaxi[playerb] == 0)
        {
            
SendClientMessage(playeridCOLOR_GREY"This player hasn't ordered a Taxi");
            return 
1;
        }
    }*/ 
Well you are genius, would you mind explaining ?

EDIT -- The pawn compiles it but it doesnt really work > no CP, no SendClientMessage, nothing
Reply
#6

Quote:
Originally Posted by NeXoR
Посмотреть сообщение
Well you are fucking genius, would you mind explaining ?

PHP код:
if(!strcmp(params"taxi"true))
    {
        new 
playerb;
        if(!
IsATaxidriver(playerid)) return SendClientMessage(playeridCOLOR_WHITE"You are not a Taxi driver.");
        if(
AcceptedTaxi[playerid] == 1) return SendClientMessage(playeridCOLOR_GREY"You have already accepted a taxi call.");
        if(
sscanf(params"s[128]i"paramsplayerb)) return SendClientMessage(playeridCOLOR_GREY"/accept taxi [ID]");
        if(!
IsPlayerLoggedIn(playerb) && !IsPlayerNPC(playerb)) return SendClientMessage(playeridCOLOR_GREY"Invalid player id.");
        if(
OrderedTaxi[playerb] == 1)
        {
            
format(stringsizeof(string), "You have accepted %s's Taxi call, He is now marked on your radar"RPN(playerb));
            
SendClientMessage(playeridCOLOR_YELLOWstring);
            
format(stringsizeof(string), "Taxi Driver %s is now on his way to you"RPN(playerid));
            
SendClientMessage(playerbCOLOR_YELLOWstring);
            
CP[playerid] = 8779;
            
AcceptedTaxi[playerid] = 1;
            new 
Float:PosXFloat:PosYFloat:PosZ;
            
GetPlayerPos(playerbPosXPosYPosZ);
            
SetPlayerCheckpoint(playeridPosXPosYPosZ4.0);
            return 
1;                }    <---- This was the problem.
        }
        else if(
OrderedTaxi[playerb] == 0)
        {
            
SendClientMessage(playeridCOLOR_GREY"This player hasn't ordered a Taxi");
            return 
1;
        }
    }*/ 
Reply
#7

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
PHP код:
if(!strcmp(params"taxi"true))
    {
        new 
playerb;
        if(!
IsATaxidriver(playerid)) return SendClientMessage(playeridCOLOR_WHITE"You are not a Taxi driver.");
        if(
AcceptedTaxi[playerid] == 1) return SendClientMessage(playeridCOLOR_GREY"You have already accepted a taxi call.");
        if(
sscanf(params"s[128]i"paramsplayerb)) return SendClientMessage(playeridCOLOR_GREY"/accept taxi [ID]");
        if(!
IsPlayerLoggedIn(playerb) && !IsPlayerNPC(playerb)) return SendClientMessage(playeridCOLOR_GREY"Invalid player id.");
        if(
OrderedTaxi[playerb] == 1)
        {
            
format(stringsizeof(string), "You have accepted %s's Taxi call, He is now marked on your radar"RPN(playerb));
            
SendClientMessage(playeridCOLOR_YELLOWstring);
            
format(stringsizeof(string), "Taxi Driver %s is now on his way to you"RPN(playerid));
            
SendClientMessage(playerbCOLOR_YELLOWstring);
            
CP[playerid] = 8779;
            
AcceptedTaxi[playerid] = 1;
            new 
Float:PosXFloat:PosYFloat:PosZ;
            
GetPlayerPos(playerbPosXPosYPosZ);
            
SetPlayerCheckpoint(playeridPosXPosYPosZ4.0);
            return 
1;                }    <---- This was the problem.
        }
        else if(
OrderedTaxi[playerb] == 0)
        {
            
SendClientMessage(playeridCOLOR_GREY"This player hasn't ordered a Taxi");
            return 
1;
        }
    }*/ 
Thanks you helped me very much, Although unfortunately the code doesn't work
Whenever I type /accept taxi and the person's id, nothing happenes, not a checkpoint, not SendClientMessage
Reply
#8

Quote:
Originally Posted by NeXoR
Посмотреть сообщение
Thanks you helped me very much, Although unfortunately the code doesn't work
Whenever I type /accept taxi and the person's id, nothing happenes, not a checkpoint, not SendClientMessage
Show me OrderedTaxi please.
Reply
#9

bump
Reply
#10

How about making it with ZCMD and SSCANF? It would be much easier and it would much faster than strcmp. If you actually change it I might help you but otherwise no.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)