#9

Quote:
Originally Posted by Rufio
Посмотреть сообщение
He says there are no errors, read the whole script and you can see the mistakes.

I have seen a few of them, don't have enough time to check them all out though. Here is my assumptions of how it should work;

pawn Код:
dcmd_Createpv(playerid, params[])
{
     new cmd[256],id, lvla, scelta, lvla2, cmd2[256], scelta2;
     //if(PlayerInfo[playerid][gangid] ==0) return SendClientMessage(playerid,COLORE_ROSSO,"ERROR:You are not in any gang.");
     cmd = strtok(params, scelta);
     cmd2 = strtok(params, scelta2);
     if (!strlen(cmd))return SendClientMessage(playerid,COLORE_ROSSO, "Use: /Createpv [playerid] [vehicleid] [vehiclecolor].");
     if (!strlen(cmd2))return SendClientMessage(playerid,COLORE_ROSSO, "Use: /Createpv [playerid] [vehicleid] [vehiclecolor].");
     //if (!strlen(cmd2))return SendClientMessage(playerid,COLORE_ROSSO, "Use: /Createpv [playerid] [vehicleid] [vehiclecolor].");
     id = strval(cmd);
     id = strval(cmd2);
     if(!IsPlayerConnected(id))
     {
     SendClientMessage(playerid,COLORE_ROSSO, "ERROR:The player is not connect.");
     } // I've removed return 1 because it was completely unnecessary and wrong, you don't need to put return 1 after each if statement.
         else // I've put an else here, seeing as there were no callbacks to be called here.
     {
     cmd = strtok(params, scelta);
     if (!strlen(cmd))
     {
     SendClientMessage(playerid,COLORE_ROSSO, "Use: /Createpv [playerid] [vehicleid] [vehiclecolor].");
     }
     lvla = strval(cmd);
     if(lvla < 400 || lvla > 611)
     {
     SendClientMessage(playerid,COLORE_ROSSO, "ERROR: Invald vehicle id.");
     }
     
     
     cmd2 = strtok(params, scelta2);
     if (!strlen(cmd2))
     {
     SendClientMessage(playerid,COLORE_ROSSO, "Use: /Createpv [playerid] [vehicleid] [vehiclecolor].");
     }
     lvla2 = strval(cmd2);
     if(lvla2 < 0 || lvla2 > 255)
     {
     SendClientMessage(playerid,COLORE_ROSSO, "ERROR: Invald vehicle color.");
     }
     PlayerInfo[id][PrivateCar] = lvla;
     PlayerInfo[id][CarColor] = lvla2;
     SendClientMessage(playerid,COLORE_VERDE,"Successfully.");
     }
     return 1;
}
This should work like a charm if you haven't done any other script mistakes, if it doesn't then i will look for your script mistakes, you'll have to tell me what exactly you want this script to do though.
If i type /createpv [id] [carid] and not [carcolor] the cmd send this message
[13:07:23] ERROR: Invald vehicle color.
[13:07:23] Successfully.

If i type /createpv [id] and not [carid] [carcolor] the cmd send this message

[13:07:05] Use: /Createpv [playerid] [vehicleid] [vehiclecolor].
[13:07:05] ERROR: Invald vehicle id.
[13:07:05] Use: /Createpv [playerid] [vehicleid] [vehiclecolor].
[13:07:05] Successfully.

If i type /createpv [id] [carid] [carcolor] with all correct, the cmd send this message

[13:07:29] ERROR: Invald vehicle color.
[13:07:29] Successfully.
And wrong to set carcolor, it always set to 0 like if i don't put the carcolor
Reply


Messages In This Thread
Help - by BlackEvils - 07.01.2016, 01:23
Re: Help - by colonel-top - 07.01.2016, 02:11
Re: Help - by BlackEvils - 07.01.2016, 02:47
Re: Help - by BlackEvils - 08.01.2016, 05:55
Re: Help - by BlackEvils - 08.01.2016, 06:24
Re: Help - by Amunra - 08.01.2016, 06:43
Re: Help - by Rufio - 08.01.2016, 08:41
[No subject] - by Sew_Sumi - 08.01.2016, 09:37
Re: Help - by BlackEvils - 08.01.2016, 11:10
Re: Help - by DarK_FeneR - 08.01.2016, 11:41

Forum Jump:


Users browsing this thread: 1 Guest(s)