/crash command
#1

Im making a /crash command but i forget what you need to give to the player and it will make them crash i think it is some type of object
Reply
#2

pawn Code:
new player1;
GetPlayerPos(player1,X,Y,Z);
new objectcrash = CreatePlayerObject(player1,11111111,X,Y,Z,0,0,0);
DestroyObject(objectcrash);
Reply
#3

I get 2 errors
pawn Code:
C:\Users\Ryan\Desktop\World Wide RolePlay\gamemodes\WWRP.pwn(31946) : error 001: expected token: ";", but found "new"
C:\Users\Ryan\Desktop\World Wide RolePlay\gamemodes\WWRP.pwn(31946) : error 017: undefined symbol "X"


pawn Code:
if(strcmp(cmd, "/crash", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /crash [playerid/PartOfName]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {

                        new Float:x, Float:y, Float:z;
                        GetPlayerPos(giveplayerid, x, y, z)
                        new objectcrash = CreatePlayerObject(giveplayerid,11111111,X,Y,Z,0,0,0);
                        DestroyObject(objectcrash);
                    }
                }
                else
                {
                    format(string, sizeof(string), "   %d is not an active player !", giveplayerid);
                    SendClientMessage(playerid, COLOR_GRAD1, string);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   You are not authorized to use that command !");
            }
        }
        return 1;
    }

EDIT : i fix the frist error but now i got C:\Users\Ryan\Desktop\World Wide RolePlay\gamemodes\WWRP.pwn(31946) : error 017: undefined symbol "X"
Reply
#4

Ah, on this line...

pawn Code:
new objectcrash = CreatePlayerObject(giveplayerid,11111111,X,Y,Z,0,0,0);
Change X,Y,Z to lowercase: x,y,z
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)