Questions
#1

1. How do i put a black berder around a regular textdraw?

2. How do i make a textdraw right below the cash hub that displays the value from playerdata[playerid][bank] and auto updates every 3 seconds?

3. How do i make it so that when an admin enters a vehicle it changes the plates to their name? playerdata[playerid][level] > 0

4. How do i make a /loc [playername] command that uses the zone.inc to tell someone where a player is located?
Reply
#2

Ok this code is for your question #3, to set plate to admin name:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new n[MAX_PLAYER_NAME], veh;
    GetPlayerName(playerid, n, sizeof(n));
    veh = GetPlayerVehicleID(playerid);
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(playerdata[playerid][level] > 0)
        {
            SetVehicleNumberPlate(veh, n);
            return 1;
        }
    }

    return 1;
}
NOTE: Untested
Reply
#3

Quote:
Originally Posted by Rokzlive
Посмотреть сообщение
2. How do i make a textdraw right below the cash hub that displays the value from playerdata[playerid][bank] and auto updates every 3 seconds?

4. How do i make a /loc [playername] command that uses the zone.inc to tell someone where a player is located?
2, just create the textdraw like you normally would(one for each player), then loop through all the players every 3 seconds and update the textdraw. or, you could just update the textdraw when a player withdraws/deposits/taxes etc, would be much more efficent.

four.
pawn Код:
COMMAND:loc(playerid, params[])
{
    new otherplayerid,string[75],zone[MAX_ZONE_NAME],gName[25];
    if(sscanf(params, "u", otherplayerid)) return SendClientMessage(playerid, color,"use /loc [ID]");
    if(!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid, color, "not connect blah blah");
    else
    {
        GetPlayerName(otherplayerid, gName, 25);
        GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
        format(string, sizeof(string),"%s is located at %s",gName,zone);
        SendClientMessage(playerid, color,string);
    }
    return 1;
}
whipped that up just before so i'm not sure if it will work or not.
i used this include also, so check if it's the one you use. https://sampforum.blast.hk/showthread.php?tid=27598
Reply
#4

Anyone got question 1?
Reply
#5

TextDrawSetOutline()
Reply
#6

Quote:
Originally Posted by Hayden_Bruin
Посмотреть сообщение
2, just create the textdraw like you normally would(one for each player), then loop through all the players every 3 seconds and update the textdraw. or, you could just update the textdraw when a player withdraws/deposits/taxes etc, would be much more efficent.

four.
pawn Код:
COMMAND:loc(playerid, params[])
{
    new otherplayerid,string[75],zone[MAX_ZONE_NAME],gName[25];
    if(sscanf(params, "u", otherplayerid)) return SendClientMessage(playerid, color,"use /loc [ID]");
    if(!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid, color, "not connect blah blah");
    else
    {
        GetPlayerName(otherplayerid, gName, 25);
        GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
        format(string, sizeof(string),"%s is located at %s",gName,zone);
        SendClientMessage(playerid, color,string);
    }
    return 1;
}
whipped that up just before so i'm not sure if it will work or not.
i used this include also, so check if it's the one you use. https://sampforum.blast.hk/showthread.php?tid=27598
pawn Код:
COMMAND:loc(playerid, params[])
{
    new ID, string[128], zone[MAX_ZONE_NAME];
    if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFFFF00AA,"use /loc [ID]");
    else if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFFFF00AA, "not connect blah blah");
    else
    {
        new gName[MAX_PLAYER_NAME];
        GetPlayerName(ID, gName, sizeof(gName));
        GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
        format(string, sizeof(string),"%s is located at %s", gName, zone);
        SendClientMessage(playerid, 0xFFFF00AA,string);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)