Need help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help (
/showthread.php?tid=96335)
Need help -
Striker_Moe - 07.09.2009
Код:
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.
Re: Need help -
dice7 - 07.09.2009
urm, use a loop
Re: Need help -
Clavius - 07.09.2009
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
Re: Need help -
Striker_Moe - 07.09.2009
Whats a loop? Im new to this crap
Re: Need help -
Clavius - 07.09.2009
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
Re: Need help -
dice7 - 07.09.2009
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)
Re: Need help -
Striker_Moe - 07.09.2009
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"
Re: Need help -
dice7 - 07.09.2009
MAX_PLAYERS, not PLAERS. And the first GetPlayerPos and SetPlayerPos are useless
Re: Need help -
Striker_Moe - 07.09.2009
Why? I dont want them teleported into the club while in a vehicle.
Re: Need help -
Striker_Moe - 07.09.2009
Код:
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"