[HELP]Spawning objects
#2

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.
Reply


Messages In This Thread
[HELP]Spawning objects - by slowride326 - 22.03.2011, 07:58
Re: [HELP]Spawning objects - by Stigg - 22.03.2011, 08:04
Re: [HELP]Spawning objects - by slowride326 - 22.03.2011, 08:08
Re: [HELP]Spawning objects - by Stigg - 22.03.2011, 08:17
Re: [HELP]Spawning objects - by slowride326 - 22.03.2011, 08:18
Re: [HELP]Spawning objects - by Stigg - 22.03.2011, 08:21

Forum Jump:


Users browsing this thread: 1 Guest(s)