Need help
#1

Код:
	if(strcmp(cmd, "/party", true) == 0) 
	{
	 	if (AccountInfo[playerid][AdminLevel] > 3 || IsPlayerAdmin(playerid))
	 	{
		SendClientMessageToAll(0xDEEE20FF, "PARTY TIME! YEHAA!");
 		GetPlayerPos(i,pX,pY,pZ);
  	SetPlayerPos(i,pX,pY,pZ+5);
		SetPlayerInterior(i, 3);
		SetPlayerPos(playerid,-2637.69,1404.24,906.46);
		ResetPlayerWeapons(i);
		}
	 	else SendClientMessage(playerid, RED, "No party for you");
		return 1;
	}
I though i is everyone? I get errors when compiling, the command should slap all, TP them to Jizzys, send them a message and disarm them.

PS: Is there a callback to disable interior exits? If yes, Iґd like to have that implemented.
Reply
#2

urm, use a loop
Reply
#3

Quote:
Originally Posted by Mo3
PS: Is there a callback to disable interior exits? If yes, Iґd like to have that implemented.
Yes, look here: https://sampwiki.blast.hk/wiki/DisableInteriorEnterExits
Reply
#4

Whats a loop? Im new to this crap
Reply
#5

well, for example,
pawn Код:
for (new i = 0; i < MAX_PLAYERS; i++)
{
    // do something with current player (which is 'i')
}
And you should read this topic:
http://forum.sa-mp.com/index.php?topic=2750.0
Reply
#6

or
pawn Код:
new i = 0;
while (i < MAX_PLAYERS)
{
  // do something with current player (which is 'i')
  i++;
}
or

pawn Код:
new i = 0;
do
{
  // do something with current player (which is 'i')
  i++;
}
while (i<MAX_PLAYERS)
Reply
#7

k, Iґve done it like this:

Код:
	if(strcmp(cmd, "/party", true) == 0) // Will make the player invinsible until death
	{
	 	if (AccountInfo[playerid][AdminLevel] > 3 || IsPlayerAdmin(playerid))
	 	{
	 		for (new i = 0; i < MAX_PLAERS; i++)
			{
			SendClientMessageToAll(0xDEEE20FF, "PARTY TIME! YEHAA!");
 			GetPlayerPos(i,pX,pY,pZ);
  		    SetPlayerPos(i,pX,pY,pZ+5);
			SetPlayerInterior(i, 3);
			SetPlayerPos(i,-2637.69,1404.24,906.46);
			ResetPlayerWeapons(i);
             DisableInteriorEnterExits();
			}
		}
	 	else SendClientMessage(playerid, RED, "No party for you");
		return 1;
	}
But:

admin.pwn(1387) : error 017: undefined symbol "MAX_PLAERS"
admin.pwn(1390) : error 017: undefined symbol "pX"
admin.pwn(1391) : error 017: undefined symbol "pX"
Reply
#8

MAX_PLAYERS, not PLAERS. And the first GetPlayerPos and SetPlayerPos are useless
Reply
#9

Why? I dont want them teleported into the club while in a vehicle.
Reply
#10

Код:
	if(strcmp(cmd, "/party", true) == 0) // Will make the player invinsible until death
	{
	 	if (AccountInfo[playerid][AdminLevel] > 3 || IsPlayerAdmin(playerid))
	 	{
         new i = 0;
			while (i < MAX_PLAYERS)
			{
			SendClientMessageToAll(0xDEEE20FF, "PARTY TIME! YEHAA!");
            if(IsPlayerInVehicle(i, true))
			{
				GetPlayerPos(playerid,pX,pY,pZ);
  			SetPlayerPos(playerid,pX,pY,pZ+5);
			}
			SetPlayerInterior(i, 3);
			SetPlayerPos(i,-2637.69,1404.24,906.46);
			ResetPlayerWeapons(i);
      DisableInteriorEnterExits();
      i++;
			}
		}
	 	else SendClientMessage(playerid, RED, "No party for you");
		return 1;
	}
This is what I have now, the forum software fucked it a bit up, but it looks good for now.. but still:

C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1393) : error 017: undefined symbol "pX"
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1394) : error 017: undefined symbol "pX"

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)