SA-MP Forums Archive
/rescue error - 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: /rescue error (/showthread.php?tid=431580)



/rescue error - DerickClark - 19.04.2013

rescue error i need a IsplayerLoggedIn bug to a Class over 100 score.

Код:
error 017: undefined symbol "IsPlayerLoggedIn"
Код:
// Lets the player choose where he wants to respawn (costs $200)
COMMAND:rescue(playerid, params[])
{
	// Send the command to all admins so they can see it
	SendAdminText(playerid, "/rescue", params);
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	// Check if the player has logged in
	if (APlayerData[playerid][LoggedIn] == true)
	{
		// Check if the player has a wanted level of less than 3
		if (GetPlayerWantedLevel(playerid) < 3)
		{
			// Check if the player isn't in jail
			if (APlayerData[playerid][PlayerJailed] == 0)
			{
				if (APlayerData[playerid][JobStarted] == false)
				{
					// Make sure you can't use "/rescue" when you're inside a vehicle (doesn't respawn you at the requested coords
					// and puts a random item (bottle, sigarette, ...) in the player's hands
					if (GetPlayerVehicleID(playerid) == 0)
					{
					    // Create a dialog based on the player's class
						switch (APlayerData[playerid][PlayerClass])
						{
							case ClassTrucker: // Ask where the trucker player wants to respawn
								ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Choose trucker spawn point:", "Fallen Tree Depot\r\nFlint Trucking Depot\r\nLVA Freight Depot\r\nDoherty Depot\r\nEl Corona Depot\r\nQuarry Top\r\nShady Creek Depot", "Spawn", "Cancel");
							case ClassBusDriver: // Ask where the busdriver wants to respawn
								ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Choose busdriver spawn point:", "Los Santos\r\nSan Fierro\r\nLas Venturas", "Spawn", "Cancel");
							case ClassPilot: // Ask where the pilot wants to respawn
								ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Choose pilot spawn point:", "Los Santos\r\nSan Fierro\r\nLas Venturas", "Spawn", "Cancel");
							case ClassPolice: // Ask where the police player wants to respawn
								ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Choose police spawn point:", "Los Santos\r\nSan Fierro\r\nLas Venturas", "Spawn", "Cancel");
							case ClassCourier: // Ask where the courier player wants to respawn
								ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Choose courier spawn point:", "Los Santos\r\nSan Fierro\r\nLas Venturas", "Spawn", "Cancel");
						}
					}
					else
						SendClientMessage(playerid, 0xFF0000FF, "You cannot use '/rescue' when you're inside a vehicle"); // "/rescue" doesn't work inside a vehicle
				}
				else
				    SendClientMessage(playerid, 0xFF0000FF, "You cannot use rescue when doing a job"); // "/rescue" doesn't work during a job
			}
			else
			    SendClientMessage(playerid, 0xFF0000FF, "You cannot use /rescue when you're in jail");
		}
		else
		    SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You cannot use /rescue when you're wanted");
	}
	else
	    return 0;

	// Let the server know that this was a valid command
	return 1;
}



Re: /rescue error - zDivine - 19.04.2013

pawn Код:
stock IsPlayerLoggedIn(playerid)
{
    if(IsPlayerConnected(playerid)) return 1;
    return 0;
}
Start trying to learn to code, instead of just posting every little piece of your script on here, and getting scripters to code it for you. You will never get anywhere if you don't learn how to do it yourself. You might as well find a scripter to code for you, as you're about 1 post away from showing us your entire script.


Re: /rescue error - Camacorn - 19.04.2013

Quote:
Originally Posted by zDivine
Посмотреть сообщение
pawn Код:
stock IsPlayerLoggedIn(playerid)
{
    if(IsPlayerConnected(playerid)) return 1;
    return 0;
}
Start trying to learn to code, instead of just posting every little piece of your script on here, and getting scripters to code it for you. You will never get anywhere if you don't learn how to do it yourself. You might as well find a scripter to code for you, as you're about 1 post away from showing us your entire script.
This help forum was created for a reason. Though I do agree that he could try to fix the problem himself ahead of time instead of simply copy/pasting and asking for help.