SA-MP Forums Archive
zcmd? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: zcmd? (/showthread.php?tid=577122)



zcmd? - alexanderjb918 - 09.06.2015

Код:
C:\Users\ii\Desktop\New Folder (2)\gamemodes\clrps latest.pwn(14932) : error 017: undefined symbol "sendername"
C:\Users\ii\Desktop\New Folder (2)\gamemodes\clrps latest.pwn(14932) : error 017: undefined symbol "sendername"
C:\Users\ii\Desktop\New Folder (2)\gamemodes\clrps latest.pwn(14932) : error 029: invalid expression, assumed zero
C:\Users\ii\Desktop\New Folder (2)\gamemodes\clrps latest.pwn(14932) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Код:
CMD:carwindows(playerid, params[])
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(IsPlayerInAnyVehicle(playerid))
	    {
				{
				  SendClientMessage(playerid, COLOR_GREY, " This vehicle doesn't have the window to roll");
				  return 1;
				}
	      if(VehicleWindows[GetPlayerVehicleID(playerid)] == 0)
	      {
	      	VehicleWindows[GetPlayerVehicleID(playerid)] = 1;
   	      	GetPlayerName(playerid, sendername, sizeof(sendername));
   				format(string, sizeof(string), "* %s rolls down the window.", sendername);
   				ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
   				return 1;
				}
				else if(VehicleWindows[GetPlayerVehicleID(playerid)] == 1)
				{
				  VehicleWindows[GetPlayerVehicleID(playerid)] = 0;
	      	GetPlayerName(playerid, sendername, sizeof(sendername));
   				format(string, sizeof(string), "* %s rolls up the window.", sendername);
   				ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
   				return 1;
				}
				return 1;
	    }
	    else
	    {
	      SendClientMessage(playerid, COLOR_GREY, "  You need to be in the vehicle to use this function !");
	      return 1;
	    }
	  }
	  return 1;
}



Re: zcmd? - J0sh... - 09.06.2015

PHP код:
CMD:windows(playeridparams[])
{
    if(
IsPlayerConnected(playerid))
    {
        if(
IsPlayerInAnyVehicle(playerid))
        {
            {
                
SendClientMessage(playeridCOLOR_GREY" This vehicle doesn't have the window to roll");
                return 
1;
            }
            if(
VehicleWindows[GetPlayerVehicleID(playerid)] == 0)
            {
                
VehicleWindows[GetPlayerVehicleID(playerid)] = 1;
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
format(stringsizeof(string), "* %s rolls down the window."sendername);
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                return 
1;
            }
            else if(
VehicleWindows[GetPlayerVehicleID(playerid)] == 1)
            {
                
VehicleWindows[GetPlayerVehicleID(playerid)] = 0;
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
format(stringsizeof(string), "* %s rolls up the window."sendername);
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                return 
1;
            }
            return 
1;
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY"  You need to be in the vehicle to use this function !");
            return 
1;
        }
    }
    return 
1;
}

CMD:w(playeridparams[]) { return  cmd_windows(playeridparams); } 



Re: zcmd? - alexanderjb918 - 09.06.2015

+rep many thanks for you're time il be testing it now


Re: zcmd? - dominik523 - 09.06.2015

Next time try to search for a tutorial about this. It's not that difficult to understand.


Re: zcmd? - alexanderjb918 - 09.06.2015

Updated it im now getting these errors


Re: zcmd? - dominik523 - 09.06.2015

Which errors?


Re: zcmd? - alexanderjb918 - 09.06.2015

[CODE]C:\Users\ii\Desktop\New Folder (2)\gamemodes\clrps latest.pwn(14932) : error 017: undefined symbol "sendername"
C:\Users\ii\Desktop\New Folder (2)\gamemodes\clrps latest.pwn(14932) : error 017: undefined symbol "sendername"
C:\Users\ii\Desktop\New Folder (2)\gamemodes\clrps latest.pwn(14932) : error 029: invalid expression, assumed zero
C:\Users\ii\Desktop\New Folder (2)\gamemodes\clrps latest.pwn(14932) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.[CODE]


Re: zcmd? - J0sh... - 09.06.2015

You need to do new sendername[MAX_PLAYER_NAME+1].


Re: zcmd? - XBrianX - 09.06.2015

Quote:
Originally Posted by alexanderjb918
Посмотреть сообщение
[CODE]C:\Users\ii\Desktop\New Folder (2)\gamemodes\clrps latest.pwn(14932) : error 017: undefined symbol "sendername"
C:\Users\ii\Desktop\New Folder (2)\gamemodes\clrps latest.pwn(14932) : error 017: undefined symbol "sendername"
C:\Users\ii\Desktop\New Folder (2)\gamemodes\clrps latest.pwn(14932) : error 029: invalid expression, assumed zero
C:\Users\ii\Desktop\New Folder (2)\gamemodes\clrps latest.pwn(14932) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.[CODE]
Update all your plugins with the includes .inc and use the updated version of PAWNO.exe


Re: zcmd? - dominik523 - 09.06.2015

Quote:
Originally Posted by XBrianX
Посмотреть сообщение
Update all your plugins with the includes .inc and use the updated version of PAWNO.exe
This has nothing to do with outdated plugins or includes.

@Jamester: there's no need for +1 when declaring a string to store player's name.