SetPlayerMarkerForPlayer -
Gooday - 20.02.2012
pawn Код:
CMD:911(playerid, params[])
{
//911 system
if(isnull(params)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Usage: /911 [Message and Location]");
new sendername[MAX_PLAYER_NAME], string[128], id;
GetPlayerName(playerid, sendername, sizeof(sendername));
SendClientMessage(playerid, COLOR_GOLD, "[INFO]You have just called 911. Please Remain at your Location and wait.");
for(new i=0;i<MAX_PLAYERS;i++) {
if(GetPlayerSkin(i) == 285 || GetPlayerSkin(i) == 282 || GetPlayerSkin(i) == 281 || GetPlayerSkin(i) == 283 || GetPlayerSkin(i) == 288 ||GetPlayerSkin(i) == 278 || GetPlayerSkin(i) == 275 || GetPlayerSkin(i) == 279 || GetPlayerSkin(i) == 277 || GetPlayerSkin(i) == 274 || GetPlayerSkin(i) == 276) {
SendClientMessage(i, COLOR_GREY, "-------------------------------------------------------------------------------------------------");
SendClientMessage(i, COLOR_ROYALBLUE, "DPS AUTOMATED DISPATCH");
SendClientMessage(i, COLOR_GREY, "Be advised. The following is a 911 call relay.");
format(string, sizeof(string), "Caller name: %s", sendername);
SendClientMessage(i, COLOR_GREY, string);
format(string, sizeof(string), "Quoted informations: %s", params);
SendClientMessage(i, COLOR_GREY, string);
SendClientMessage(i, COLOR_GREY, "Suggested action: Get to the scene for a verify of the call.");
SendClientMessage(i, COLOR_GREY, "Call code: Unknown.");
SendClientMessage(i, COLOR_GREY, "-------------------------------------------------------------------------------------------------");
if(GetPlayerSkin(i) == 285 || GetPlayerSkin(i) == 282 || GetPlayerSkin(i) == 281 || GetPlayerSkin(i) == 283 || GetPlayerSkin(i) == 288 ||GetPlayerSkin(i) == 278 || GetPlayerSkin(i) == 275 || GetPlayerSkin(i) == 279 || GetPlayerSkin(i) == 277 || GetPlayerSkin(i) == 274 || GetPlayerSkin(i) == 276)
SetPlayerMarkerForPlayer( playerid, id, 0xFF0000FF);
}
}
return 1;
}
When someone type the command the skins won't see the map marked...The marker wont show!
+REP!
Re: SetPlayerMarkerForPlayer -
[MG]Dimi - 20.02.2012
Код:
(playerid, showplayerid, color)
pawn Код:
CMD:911(playerid, params[])
{
//911 system
if(isnull(params)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Usage: /911 [Message and Location]");
new sendername[MAX_PLAYER_NAME], string[128], id;
GetPlayerName(playerid, sendername, sizeof(sendername));
SendClientMessage(playerid, COLOR_GOLD, "[INFO]You have just called 911. Please Remain at your Location and wait.");
for(new i=0;i<MAX_PLAYERS;i++) {
if(GetPlayerSkin(i) == 285 || GetPlayerSkin(i) == 282 || GetPlayerSkin(i) == 281 || GetPlayerSkin(i) == 283 || GetPlayerSkin(i) == 288 ||GetPlayerSkin(i) == 278 || GetPlayerSkin(i) == 275 || GetPlayerSkin(i) == 279 || GetPlayerSkin(i) == 277 || GetPlayerSkin(i) == 274 || GetPlayerSkin(i) == 276) {
SendClientMessage(i, COLOR_GREY, "-------------------------------------------------------------------------------------------------");
SendClientMessage(i, COLOR_ROYALBLUE, "DPS AUTOMATED DISPATCH");
SendClientMessage(i, COLOR_GREY, "Be advised. The following is a 911 call relay.");
format(string, sizeof(string), "Caller name: %s", sendername);
SendClientMessage(i, COLOR_GREY, string);
format(string, sizeof(string), "Quoted informations: %s", params);
SendClientMessage(i, COLOR_GREY, string);
SendClientMessage(i, COLOR_GREY, "Suggested action: Get to the scene for a verify of the call.");
SendClientMessage(i, COLOR_GREY, "Call code: Unknown.");
SendClientMessage(i, COLOR_GREY, "-------------------------------------------------------------------------------------------------");
SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
}
}
return 1;
}
Should work.
Re: SetPlayerMarkerForPlayer -
Gooday - 20.02.2012
What i should do?
Re: SetPlayerMarkerForPlayer -
chrism11 - 20.02.2012
Quote:
Originally Posted by Gooday
What i should do?
|
you had SetPlayerMarkerForPlayer( playerid, id, 0xFF0000FF); id was just new id; wasnt defines so it was showing the player that called 911 id 0's marker
if you change it to
SetPlayerMarkerForPlayer( i, playerid, 0xFF0000FF);
it will show the cops the player that called 911's position
+rep if i helped
Re: SetPlayerMarkerForPlayer -
ReneG - 20.02.2012
You are using SetMarkerForPlayer incorrectly.
You are using.
pawn Код:
SetPlayerMarkerForPlayer( playerid, id, 0xFF0000FF);
When it should be.
pawn Код:
SetPlayerMarkerForPlayer(playerid, i, 0xFF0000FF);
Try that out and see how it does.
Re: SetPlayerMarkerForPlayer -
[MG]Dimi - 21.02.2012
You are misunderstooding params of this function. (forwhichplayers, whosemarker,color)
Re: SetPlayerMarkerForPlayer -
Toreno - 21.02.2012
Try this.
pawn Код:
CMD:911( playerid, params[] )
{
//911 system
if( isnull( params ) )
return SendClientMessage( playerid, COLOR_LIGHTBLUE, "Usage: /911 [Message and Location]" );
new
sendername[ 24 ],
string[ 128 ],
;
GetPlayerName( playerid, sendername, 24 );
SendClientMessage( playerid, COLOR_GOLD, "[INFO]You have just called 911. Please Remain at your Location and wait." );
for( new a, b = GetMaxPlayers(); a < b; a++ )
{
if( !IsPlayerConnected( a ) )
continue;
switch( GetPlayerSkin( a ) )
{
case 285, 282, 281, 283, 288, 278, 275, 279, 277, 274, 276:
{
SendClientMessage( i, COLOR_GREY, "-------------------------------------------------------------------------------------------------" );
SendClientMessage( i, COLOR_ROYALBLUE, "DPS AUTOMATED DISPATCH" );
SendClientMessage( i, COLOR_GREY, "Be advised. The following is a 911 call relay." );
format( string, 128, "Caller name: %s", sendername );
SendClientMessage( i, COLOR_GREY, string );
format( string, 128, "Quoted informations: %s", params );
SendClientMessage( i, COLOR_GREY, string );
SendClientMessage( i, COLOR_GREY, "Suggested action: Get to the scene for a verify of the call." );
SendClientMessage( i, COLOR_GREY, "Call code: Unknown." );
SendClientMessage( i, COLOR_GREY, "-------------------------------------------------------------------------------------------------" );
SetPlayerMarkerForPlayer( playerid, i, 0xFF0000FF );
}
}
}
return 1;
}