SA-MP Forums Archive
/showid - 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: /showid (/showthread.php?tid=299280)



/showid - Jordiee - 25.11.2011

How would I make a command if someone says: /showid [id]
----------------------------
Citizen of Bayside
Name:
Age:

Licenses:
(If you have a gun license)
(if you have a Driving License)
(if you have a flying License)
----------------------------

I tried and failed, so I ended up deleting it >.>


Re: /showid - Mr_Scripter - 25.11.2011

read my pm..


Re: /showid - [MG]Dimi - 25.11.2011

Give us your try and we will correct it. Anyay post variables for Name, Age and Licences


Re: /showid - Jordiee - 25.11.2011

sorry Dimi I deleted it, I did say above >.<


Re: /showid - [MG]Dimi - 25.11.2011

Quote:
Originally Posted by Dimi
Anyay post variables for Name, Age and Licences
^^^^


Re: /showid - Jordiee - 25.11.2011

as in: pName, pAge and pLicenses?


Re: /showid - Jordiee - 25.11.2011

Код:
CMD:showid(playerid, params[]) {

	format(szMessage, sizeof(szMessage), "%s | Age: %d (born %d)", playerVariables[targetid][pNormalName], date[0]-playerVariables[targetid][pAge]);
The format, just use that as an example and I will learn from there.


Re: /showid - [MG]Dimi - 25.11.2011

PHP код:
CMD:showid(playerid,params[])
{
    new 
target,msg[128],tName[24],aName[24],Float:Pos[3];
    if(
sscanf(params,"d",target)) return SendClientMessage(playerid,-1,"Usage: /showid [id]");
    if(!
IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"Invalid player ID!");
    
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
    if(!
IsPlayerInRangeOfPoint(target,7.0,Pos[0],Pos[1],Pos[2])) return SendClientMessage(playerid,-1,"This player is too away from you!");
    
GetPlayerName(playerid,aName,24);
    
GetPlayerName(target,tName,24);
    
SendClientMessage(target,-1,"===================================");
    
format(msg,128,"Indetification of %s(%d):",aName,playerid);
    
SendClientMessage(target,-1,msg);
    
format(msg,128,"Name: %s | Age: %i | Driving Licence: %i | Flying Licence: %i | Gun Licence: %i",pName[playerid],pAge[playerid],pLicences[playerid][Driving],pLicences[playerid][Flying],pLicences[playerid][Gun]);
    
//You edit Variables how they are in your script
    
SendClientMessage(target,-1,msg);
    
SendClientMessage(target,-1,"===================================");
    
format(msg,128,"You have showed your indetification card to %s(%d)."tName,target);
    
SendClientMessage(playerid,-1,msg);
    return 
1;

Something like this. It's UNTESTED! You edit it however you want


Re: /showid - Jordiee - 25.11.2011

4 errors, my player eNums for the licenses
pDL, pGl, pFl and it still dont work


Re: /showid - [MG]Dimi - 25.11.2011

Edit my code to yours and then post it together with errors