07.01.2016, 01:23
Help
07.01.2016, 02:11
Why you not compile and give us error ? :P our brain not Compiler lol so this will easier for people help you
07.01.2016, 02:47
Quote:
Why you not compile and give us error ? :P our brain not Compiler lol so this will easier for people help you
|
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.");
return 1;
}
08.01.2016, 05:55
help me pls!
08.01.2016, 06:24
in this case http://pastebin.com/cCpW5fQK
i write corect cmd and it send me all times the car color its wrong
i write corect cmd and it send me all times the car color its wrong
08.01.2016, 06:43
Compile the script And Reply the Error ! And The line of errors !!, If you want We Help
08.01.2016, 08:41
Quote:
Compile the script And Reply the Error ! And The line of errors !!, If you want We Help
|
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;
}
08.01.2016, 09:37
This is a reason why you use indentation...
08.01.2016, 11:10
Quote:
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 Код:
|
[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
08.01.2016, 11:41
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))
{
return 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))
{
return SendClientMessage(playerid,COLORE_ROSSO, "Use: /Createpv [playerid] [vehicleid] [vehiclecolor].");
}
lvla = strval(cmd);
if(lvla < 400 || lvla > 611)
{
return SendClientMessage(playerid,COLORE_ROSSO, "ERROR: Invald vehicle id.");
}
cmd2 = strtok(params, scelta2);
if (!strlen(cmd2))
{
return SendClientMessage(playerid,COLORE_ROSSO, "Use: /Createpv [playerid] [vehicleid] [vehiclecolor].");
}
lvla2 = strval(cmd2);
if(lvla2 < 0 || lvla2 > 255)
{
return SendClientMessage(playerid,COLORE_ROSSO, "ERROR: Invald vehicle color.");
}
PlayerInfo[id][PrivateCar] = lvla;
PlayerInfo[id][CarColor] = lvla2;
SendClientMessage(playerid,COLORE_VERDE,"Successfu lly.");
}
return 1;
}
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)