/crash command - 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: /crash command (
/showthread.php?tid=244358)
/crash command -
yarrum3 - 27.03.2011
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
Re: /crash command -
grand.Theft.Otto - 27.03.2011
pawn Code:
new player1;
GetPlayerPos(player1,X,Y,Z);
new objectcrash = CreatePlayerObject(player1,11111111,X,Y,Z,0,0,0);
DestroyObject(objectcrash);
Re: /crash command -
yarrum3 - 27.03.2011
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"
Re: /crash command -
grand.Theft.Otto - 27.03.2011
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