Could some help me to do admin teleport?
#1

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?
Reply
#2

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

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

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

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;

}
Reply
#5

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;

}
Reply
#6

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.");

}


}
Reply
#7

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;
}
Reply
#8

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;
    }
}
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)