Questions - 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: Questions (
/showthread.php?tid=209660)
Questions -
Rokzlive - 11.01.2011
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?
Re: Questions -
wilko1995 - 11.01.2011
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
Re: Questions -
Haydz - 11.01.2011
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
Re: Questions -
Rokzlive - 11.01.2011
Anyone got question 1?
Re: Questions -
_rAped - 11.01.2011
TextDrawSetOutline()
Re: Questions -
HyperZ - 11.01.2011
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;
}