SA-MP Forums Archive
Could some help me to do admin teleport? - 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: Could some help me to do admin teleport? (/showthread.php?tid=87594)



Could some help me to do admin teleport? - velkarumpali - 21.07.2009

So, i'm making admin tele what also gives minigun to admin. This what i have for now

287 //------------------------------------//TW1-----------------------------------------
288 if(strcmp(cmdtext, "//tw1",true)==0){
289
290 if(IsAdmin == 1)
291
292 SetPlayerPos(playerid, 413,2543,30);
293 SetPlayerInterior(playerid,0);
294 if(IsAdmin == 1)
295 GivePlayerWeapon(playerid,38,1000);
296 SendClientMessage(playerid, 0xFFFF00AA, "***Shoot chitters with minigun.");
297 else
298
299 SendClientMessage(playerid, 0xFFFF00AA, "***You can't go there, and there's nothing to see anyway");
300
301 return 1;
302
303 }


And it worked before I putted that non admin text thing

else

SendClientMessage(playerid, 0xFFFF00AA, "***You can't go there, and there's nothing to see anyway");

here's all errors and warnings it say

C:\Users\Perttu\Documents\Downloads\samp02Xserver. win32\gamemodes\velka.pwn(293) : warning 217: loose indentation
C:\Users\Perttu\Documents\Downloads\samp02Xserver. win32\gamemodes\velka.pwn(294) : warning 217: loose indentation
C:\Users\Perttu\Documents\Downloads\samp02Xserver. win32\gamemodes\velka.pwn(296) : warning 217: loose indentation
C:\Users\Perttu\Documents\Downloads\samp02Xserver. win32\gamemodes\velka.pwn(297) : warning 217: loose indentation
C:\Users\Perttu\Documents\Downloads\samp02Xserver. win32\gamemodes\velka.pwn(297) : error 029: invalid expression, assumed zero
C:\Users\Perttu\Documents\Downloads\samp02Xserver. win32\gamemodes\velka.pwn(297 -- 299) : warning 215: expression has no effect
C:\Users\Perttu\Documents\Downloads\samp02Xserver. win32\gamemodes\velka.pwn(299) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Perttu\Documents\Downloads\samp02Xserver. win32\gamemodes\velka.pwn(299) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

So, what i did wrong?


Re: Could some help me to do admin teleport? - Grim_ - 21.07.2009

1) You aren't using brackets.
2) You put integers where floats should be. You can't put whole numbers in the SetPlayerPos function.


Re: Could some help me to do admin teleport? - velkarumpali - 21.07.2009

The teleport worked with whole numbers but i test with decimals.

EDIT: Decimals didn't do anything, so it's cause brackets?


Re: Could some help me to do admin teleport? - velkarumpali - 21.07.2009

Now it looks this but there's still one error, invalid expression, assumed zero and there's word else now, so what there should stand?
//------------------------------------//TW1-----------------------------------------
if(strcmp(cmdtext, "//tw1",true)==0){

if(IsAdmin == 0)

SendClientMessage(playerid, 0xFFFF00AA, "***You can't go there, and there's nothing to see anyway");
SetPlayerPos(playerid, 413.1,2543.1,30.1);
SetPlayerInterior(playerid,0);

else
GivePlayerWeapon(playerid,38,1000);
SendClientMessage(playerid, 0xFFFF00AA, "***Shoot chitters with minigun.");


return 1;

}


Re: Could some help me to do admin teleport? - velkarumpali - 21.07.2009

Now it looks this and it work, and i put the briskets so i don't need help anymore.

//------------------------------------//TW1-----------------------------------------
if(strcmp(cmdtext, "//tw1",true)==0){

if(IsAdmin == 0)

SendClientMessage(playerid, 0xFFFF00AA, "***You can't go there, and there's nothing to see anyway");

else
SetPlayerPos(playerid, 413.1,2543.1,30.1);
SetPlayerInterior(playerid,0);GivePlayerWeapon(pla yerid,38,1000);
SendClientMessage(playerid, 0xFFFF00AA, "***Shoot chitters with minigun.");


return 1;

}


Re: Could some help me to do admin teleport? - velkarumpali - 21.07.2009

Now it looks this and there's no warnings anymore

//------------------------------------//TW1-----------------------------------------
if(strcmp(cmdtext, "//tw1",true)==0){

if(IsAdmin == 0)

SendClientMessage(playerid, 0xFFFF00AA, "***You can't go there, and there's nothing to see anyway");

else
SetPlayerPos(playerid, 413.1,2543.1,30.1);
{
SetPlayerInterior(playerid,0);GivePlayerWeapon(pla yerid,38,1000);
SendClientMessage(playerid, 0xFFFF00AA, "***Shoot chitters with minigun.");

}


}


Re: Could some help me to do admin teleport? - Weirdosport - 21.07.2009

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "//tw1",true)==0)
    {
        if(!IsPlayerAdmin(playerid))
        {
            SendClientMessage(playerid, 0xFFFF00AA, "***You can't go there, and there's nothing to see anyway");
        }
        else
        {
            SetPlayerPos(playerid, 413.1,2543.1,30.1);
            SetPlayerInterior(playerid,0);GivePlayerWeapon(playerid,38,1000);
            SendClientMessage(playerid, 0xFFFF00AA, "***Shoot chitters with minigun.");
        }
    }
    return 0;
}



Re: Could some help me to do admin teleport? - woot - 21.07.2009

quadruple post, lol.
chitters, lol.
briskets, lol.

pawn Код:
if(strcmp(cmdtext, "//tw1",true) == 0)
{
    if(IsAdmin == 0) return SendClientMessage(playerid, 0xFFFF00AA, "***You can't go there, and there's nothing to see anyway");
    else
    {
        SetPlayerPos(playerid, 413.1,2543.1,30.1);
        SetPlayerInterior(playerid,0);
        GivePlayerWeapon(playerid,38,1000);
        SendClientMessage(playerid, 0xFFFF00AA, "***Shoot chitters with minigun.");
        return 1;
    }
}



Re: Could some help me to do admin teleport? - JBoy - 05.09.2009

sweet i just tryed it and made a base and put my level to 0 and its cool