Question. - 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: Question. (
/showthread.php?tid=303465)
Question. -
Sasoft - 13.12.2011
Hey, i just made a new command to show my ID card to someone else. But when i use the command it just shows it to myself instead of showing it to someone else.
pawn Код:
CMD:showid(playerid, params[])
{
new giveplayerid;
new string[128];
if(sscanf(params, "u", giveplayerid))
{
SendClientMessageEx(playerid, COLOR_WHITE, "[Server]: {FFFFFF}/showasl (playerid)");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
format(string, sizeof(string), "> %s has given their identifcation details to %s.", GetPlayerNameEx(playerid),GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ShowASL(playerid,giveplayerid);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "> This player isn't near you.");
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "> Invalid player specified.");
return 1;
}
return 1;
}
Do i have to change this to something else to make it work?
pawn Код:
ShowASL(playerid,giveplayerid);
Re: Question. -
Dragony92 - 13.12.2011
Can you show us your public?
Re: Question. -
Sasoft - 13.12.2011
pawn Код:
ShowASL(playerid, targetid)
{
if (IsPlayerConnected(targetid))
{
new sext[16], nat[30];
new age = PlayerInfo[targetid][pAge];
new crimes = PlayerInfo[targetid][pCrimes];
new arrests = PlayerInfo[targetid][pArrested];
switch(PlayerInfo[targetid][pAccent])
{
case 1: nat = "Unknown";
case 2: nat = "British";
case 3: nat = "Japanese";
case 4: nat = "Chinese";
case 5: nat = "Korean";
case 6: nat = "Scottish";
case 7: nat = "Irish";
case 8: nat = "Russian";
case 9: nat = "American";
case 10: nat = "Mexican";
case 11: nat = "Texan";
case 12: nat = "Cuban";
case 13: nat = "Italian";
case 14: nat = "Gangsta";
case 15: nat = "Australia";
case 16: nat = "Arabic";
case 17: nat = "Balkan";
case 18: nat = "Canadian";
case 19: nat = "Jamaican";
case 20: nat = "Israeli";
default: nat = "Unknown";
}
if(PlayerInfo[targetid][pSex] == 1) { sext = "Male"; } else { sext = "Female"; }
new string[128];
format(string, sizeof(string),"Name: {FFFFFF}%s | {AFAFAF}Age: {FFFFFF}%d | {AFAFAF}Gender: {FFFFFF}%s | {AFAFAF}Nationality: {FFFFFF}%s.", GetPlayerNameEx(targetid), age, sext, nat);
SendClientMessageEx(playerid, COLOR_GREY,string);
if(gTeam[playerid] == 2 || IsACop(playerid) || (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2) || (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5) || (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2) || (PlayerInfo[playerid][pMember] == 9 && PlayerInfo[playerid][pDivision] == 1))
{
SendClientMessage(playerid, COLOR_GREY, "> Additional LEO Information.");
format(string, sizeof(string),"Crimes commited: {FFFFFF}%d", crimes);
SendClientMessageEx(playerid, COLOR_GREY,string);
format(string, sizeof(string),"Times arrested: {FFFFFF}%d", arrests);
SendClientMessageEx(playerid, COLOR_GREY,string);
}
}
}
Re: Question. -
Sasoft - 13.12.2011
Small bump.
Re: Question. -
Mokerr - 13.12.2011
Change
pawn Код:
SendClientMessageEx(playerid, COLOR_GREY,string);
to
pawn Код:
SendClientMessageEx(targetid, COLOR_GREY,string);
at your public