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



Mini Help - Zorono - 14.05.2016

deletted


Re: Mini Help - BiosMarcel - 14.05.2016

First of all ... i have made your code properly:

PHP код:
new vowned[8];

CMD:cars(playerid,params[]) {
    new 
player1;
    if(
sscanf(params,"i",player1)) {
        new 
handle[770],string[128];
        
format(string,sizeof string,"{FFFF00}NickName : %s\n",pName(playerid));
        
strcat(handle,string);
        for(new 
0sizeof(vowned); i++)
        {
            new 
string[100];
            
format(string,sizeof(string),"\n{FFFFFF}Slot %i: Empty", (i+1));
            if(!
PlayerInfo[playerid][vowned[i]]) strcat(handle,string);
            
format(string,sizeof string,"\n{FFFFFF}Slot %i: {33FF33}%s {FFFFFF}ID: {33FF33}%d",(i+1),VehicleInfo[GetPlayerVehicleID(playerid)][name],GetPlayerVehicleID(playerid));
            
strcat(handle,string);
        }
        return 
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"Player List"handle"Ok""");
    }
    new 
handle[770],string[128];
    
format(string,sizeof string,"{FFFF00}NickName : %s\n",pName(player1));
    
strcat(handle,string);
    for(new 
0sizeof(vowned); i++)
    {
        new 
string[100];
        
format(string,sizeof(string),"\n{FFFFFF}Slot %i: Empty", (i+1));
        if(!
PlayerInfo[player1][vowned[i]]) strcat(handle,string);
        
format(string,sizeof string,"\n{FFFFFF}Slot %i: {33FF33}%s {FFFFFF}ID: {33FF33}%d",(i+1),VehicleInfo[GetPlayerVehicleID(player1)][name],GetPlayerVehicleID(player1));
        
strcat(handle,string);
    }
    return 
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"Player List"handle"Ok""");

so the one who wants to fix it doesn't have to vomit ^^


Re: Mini Help - BiosMarcel - 14.05.2016

and ofc it doesnt show the cars you own but the one you are driving , youa re using getPlayerVehicleID

and to me it looks like u mixed up the "player1" and "playerid" a bit


Re: Mini Help - Konstantinos - 14.05.2016

After refreshing the page Marcel has already replied but since I wrote it, I'm going to post it anyway.

I don't know your code but I think "vowned_" holds the vehicle ID. If so, you need to use that instead of GetPlayerVehicleID.

As for the way you use it is very bad. What Marcel did with an array is the appropriate way to do stuff like that. In the enum that is used for the PlayerInfo array, you need to remove vowned, vowned2 ... vowned8 and add vowned[8]

Then all you have to do is:
PHP код:
CMD:cars(playeridparams[])
{
    new 
player1;
    if (
sscanf(params"i"player1)) player1 playerid;
    new 
handle[700], string[85];
    
format(handlesizeof handle"{FFFF00}NickName : %s\n"pName(player1));
    for (new 
i!= 8i++)
    {
        if (!
PlayerInfo[player1][vowned][i]) format(stringsizeof string"\n{FFFFFF}Slot %i: Empty"1);
        else 
format(stringsizeof string"\n{FFFFFF}Slot %i: {33FF33}%s {FFFFFF}ID: {33FF33}%d"1VehicleInfo[PlayerInfo[player1][vowned][i]][name], PlayerInfo[player1][vowned][i]);
        
strcat(handlestring);
    }
    
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"Player List"handle"Ok""");
    return 
1;




Re: Mini Help - Zorono - 14.05.2016

deletted


Re: Mini Help - Zorono - 16.05.2016

deletted


Re: Mini Help - Zorono - 19.05.2016

Anyone ??


Re: Mini Help - Stinged - 20.05.2016

Of course it's always going to show that it's empty.
Count is set to 0, and you're only adding to it when it's set to 1.


Re: Mini Help - Zorono - 20.05.2016

Quote:
Originally Posted by Stinged
Посмотреть сообщение
Of course it's always going to show that it's empty.
Count is set to 0, and you're only adding to it when it's set to 1.
okay sir can you show me a code ?? please