[HELP]Spawning objects - 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: [HELP]Spawning objects (
/showthread.php?tid=243246)
[HELP]Spawning objects -
slowride326 - 22.03.2011
I need a command like:
command(fire1, playerid, params[])
{
CreateExplosion(1039.0472, 2713.9814, 46.0156, 1, 10.0);
}
return 1;
}
Can someone revise this..
Re: [HELP]Spawning objects -
Stigg - 22.03.2011
Quote:
Originally Posted by slowride326
I need a command like:
command(fire1, playerid, params[])
{
CreateExplosion(1039.0472, 2713.9814, 46.0156, 1, 10.0);
}
return 1;
}
Can someone revise this..
|
pawn Код:
dcmd_explode(playerid, params[])
{
new tmp[256];
new Index;
tmp = strtok(params, Index);
new id = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid,white,"USAGE: /explode <ID>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,white,"Invalid ID");
new string[128];
GetPlayerName(id, pName, MAX_PLAYER_NAME);
format(string, 128, "You have exploded %s", pName);
SendClientMessage(playerid, white, string);
new Float:x, Float:y, Float:z;
GetPlayerPos(id, x, y, z);
CreateExplosion(x, y, z, 7, 10.0);
return 1;
}
You might need this to go with it:
pawn Код:
stock GetName(playerid)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
return pName;
}
Hope this helps or set you in the right direction.
Re: [HELP]Spawning objects -
slowride326 - 22.03.2011
no you miss understood. i want to type /fire1 and a explosion will explode at the x,y,z
Re: [HELP]Spawning objects -
Stigg - 22.03.2011
Quote:
Originally Posted by slowride326
no you miss understood. i want to type /fire1 and a explosion will explode at the x,y,z
|
Which x,y,z ? The cord's in you first post ?
Re: [HELP]Spawning objects -
slowride326 - 22.03.2011
1039.0472, 2713.9814, 46.0156 ..........yes
Re: [HELP]Spawning objects -
Stigg - 22.03.2011
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/fire1"))
{
CreateExplosion(1039.0472, 2713.9814, 46.0156, 7, 10.0);
return 1;
}
return 0;
}