[HELP]Spawning objects
#1

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

no you miss understood. i want to type /fire1 and a explosion will explode at the x,y,z
Reply
#4

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 ?
Reply
#5

1039.0472, 2713.9814, 46.0156 ..........yes
Reply
#6

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     if(!strcmp(cmdtext, "/fire1"))
     {
        CreateExplosion(1039.0472, 2713.9814, 46.0156, 7, 10.0);
        return 1;
     }
     return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)