SA-MP Forums Archive
Improving this command plox <3 - 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)
+--- Thread: Improving this command plox <3 (/showthread.php?tid=373067)



Improving this command plox <3 - NinjaChicken - 29.08.2012

ok i have this cmd
pawn Код:
CMD:maketiki(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] <= 4)
    {
        return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command.");

    }
    if(IsPlayerInAnyVehicle(playerid))
    {
        return SendClientMessage(playerid,COLOR_GRAD2,"   You can't do that while in a vehicle !");
    }
    new string[64];
    new Float:X,Float:Y,Float:Z;
    new location[MAX_ZONE_NAME];
    GetPlayerPos(playerid,X,Y,Z);
    CreateTiki(X, Y, Z);
    SetPlayerPos(playerid, X, Y-2, Z);
    SendClientMessageEx(playerid, COLOR_GRAD1,"* Tiki created !");
    GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
    format(string, sizeof(string), "AdmWarning: %s has created a tiki in %s.", GetPlayerNameEx(playerid), location);
    ABroadCast(COLOR_LIGHTRED, string, 1);
    return 1;
}
i want it to have a message when made above the actual tiki saying type /picktiki to pick it up please help


Re: Improving this command plox <3 - romas3110 - 29.08.2012

So... you want it to say "type /picktiki to pick it up" where the tiki was created?, try adding Dynamic 3D Text Label where you created the Tiki.


Re: Improving this command plox <3 - scottyishere - 29.08.2012

First make a array for 3DText IDs outside any function MAX_TIKIS represents the max amount of tikis
pawn Код:
new Text3D:Tiki3D[MAX_TIKIS];
Under CreateTiki add: // you probably have a ID for each tiki
pawn Код:
Tiki3D[tikiID]=Create3DTextLabel("/picktiki",COLOR_WHITE,...); //extra code X,Y,Z being the location of the tiki
And under DestroyTiki (or /picktiki):
pawn Код:
Delete3DTextLabel(Tiki3D[tikiID]);