SA-MP Forums Archive
Jetpack problem - 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: Jetpack problem (/showthread.php?tid=107840)



Jetpack problem - Guso - 11.11.2009

I've tried twenty times without any luck..
Could anybody tell me how to spawn a jetpack?
Quote:

Everytime i add a jetpack or something like this =
if(strcmp(cmdtext,"/jetpack",true) == 0)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
CreatePickup(370,2,X,Y,Z);
SendClientMessage(playerid, COLOR_GREY, "* Spawned jetpack");
return 1;
}

I get errors when i compile, or just by doing this basic one
Quote:

CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1);

I still get errors, is it under OnGameModeInIt ?

Quote:

public OnGameModeInit()
{
if(fexist("SAGC/Other/JoinCounter.cfg"))
{
JoinCounter = dini_Int("SAGC/Other/JoinCounter.cfg", "Connections");
printf("file \"JoinCounter.txt\" located, variable JoinCounter loaded (%d visitors)", JoinCounter);
}
else
{
dini_Create("SAGC/Other/JoinCounter.cfg");
dini_IntSet("SAGC/Other/JoinCounter.cfg", "Connections", 0);
print("file \"SAGC/Other/JoinCounter.cfg\" created with JoinCounter variable (0 visitors)");
}

Could anybody put the code in there then, seriously I've got headache because off this


Re: Jetpack problem - Karlip - 11.11.2009

SetPlayerSpecialAction(playerid,2); <- jetpack

And what are the errors when adding the CreatePickup on OngameModeInit?


Re: Jetpack problem - (.Aztec); - 11.11.2009

pawn Код:
if(strcmp(cmdtext, "/jetpack", true) == 0)
{
SetPlayerSpecialAction(playerid, 2); //Spawns them a jetpack.
SendClientMessage(playerid, COLOR_GREY, "* Spawned jetpack.");
return 1;
}



Re: Jetpack problem - Guso - 11.11.2009

public OnGameModeInit()
{
if(strcmp(cmdtext,"/jetpack",true) == 0)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
CreatePickup(370,2,X,Y,Z);
SendClientMessage(playerid, COLOR_GREY, "* Spawned jetpack");
return 1;
}
if(fexist("SAGC/Other/JoinCounter.cfg"))
{
JoinCounter = dini_Int("SAGC/Other/JoinCounter.cfg", "Connections");
printf("file \"JoinCounter.txt\" located, variable JoinCounter loaded (%d visitors)", JoinCounter);
}
else
{
dini_Create("SAGC/Other/JoinCounter.cfg");
dini_IntSet("SAGC/Other/JoinCounter.cfg", "Connections", 0);
print("file \"SAGC/Other/JoinCounter.cfg\" created with JoinCounter variable (0 visitors)");
}

Errors -
Quote:

C:\Users\GuSo\Desktop\IBP Server\gamemodes\IBP.pwn(1569) : error 017: undefined symbol "cmdtext"
C:\Users\GuSo\Desktop\IBP Server\gamemodes\IBP.pwn(1571) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\GuSo\Desktop\IBP Server\gamemodes\IBP.pwn(1571) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\GuSo\Desktop\IBP Server\gamemodes\IBP.pwn(1571) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\GuSo\Desktop\IBP Server\gamemodes\IBP.pwn(1572) : error 017: undefined symbol "playerid"
C:\Users\GuSo\Desktop\IBP Server\gamemodes\IBP.pwn(1573) : warning 213: tag mismatch
C:\Users\GuSo\Desktop\IBP Server\gamemodes\IBP.pwn(1573) : warning 213: tag mismatch
C:\Users\GuSo\Desktop\IBP Server\gamemodes\IBP.pwn(1573) : warning 213: tag mismatch
C:\Users\GuSo\Desktop\IBP Server\gamemodes\IBP.pwn(1574) : error 017: undefined symbol "playerid"
C:\Users\GuSo\Desktop\IBP Server\gamemodes\IBP.pwn(1571) : warning 203: symbol is never used: "Z"
C:\Users\GuSo\Desktop\IBP Server\gamemodes\IBP.pwn(1571) : warning 203: symbol is never used: "Y"
C:\Users\GuSo\Desktop\IBP Server\gamemodes\IBP.pwn(1571) : warning 203: symbol is never used: "X"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.




Re: Jetpack problem - omer5198 - 05.03.2011

Quote:
Originally Posted by Guso
Посмотреть сообщение
public OnGameModeInit()
{
if(strcmp(cmdtext,"/jetpack",true) == 0)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
CreatePickup(370,2,X,Y,Z);
SendClientMessage(playerid, COLOR_GREY, "* Spawned jetpack");
return 1;
}
if(fexist("SAGC/Other/JoinCounter.cfg"))
{
JoinCounter = dini_Int("SAGC/Other/JoinCounter.cfg", "Connections");
printf("file \"JoinCounter.txt\" located, variable JoinCounter loaded (%d visitors)", JoinCounter);
}
else
{
dini_Create("SAGC/Other/JoinCounter.cfg");
dini_IntSet("SAGC/Other/JoinCounter.cfg", "Connections", 0);
print("file \"SAGC/Other/JoinCounter.cfg\" created with JoinCounter variable (0 visitors)");
}

Errors -
you can't put it on
pawn Код:
GameModeInIt()
... you need to put it in
pawn Код:
OnPlayerCommandText(playerid, cmetext[])



Re: Jetpack problem - Facepunch - 24.07.2011

delete this plz


Re: Jetpack problem - Shockey HD - 24.07.2011

Quote:
Originally Posted by Facepunch
Посмотреть сообщение
delete this plz
Why so? Just because you think a post is stupid doesn't mean it should be deleted. Maybe this will solve someones problem. Stop being a post leecher bro


Re: Jetpack problem - VitalRP - 24.07.2011

pawn Код:
if(strcmp(cmd, "/jetpack", true) == 0)
{
    if(IsPlayerAdmin(playerid))
    {
        GivePlayerWeapon(playerid, 19, 1);
        SendClientMessage(playerid, 0xDEEE20FF, "Spawned a Jetpack");
    }
    return 1;
}
add that under public OnPlayerCommandText(playerid, cmdtext[])