Script problem [need help its easy] - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Script problem [need help its easy] (
/showthread.php?tid=161578)
Script problem [need help its easy] -
Chrillzen - 20.07.2010
Hi, i did an command to fix the car, (RepairVerhicle)
But, everytime i write like a command that dosent exist like /kaposdkpoasd it sais you have repaired your vehicle, even if there's no command like that or if i write wrong like /vfiiza instead of /vfix it still sais you have repaired your car, it dosent matter if i'm in the car or not, even if imin it dosent repair itself, but if i write /vfix it works, but anyway whats wrong why does it say you've repaired yourevhcile?
help! =)
Re: Script problem [need help its easy] -
Last_Stand_Guardian - 20.07.2010
Some code would be fine ^^
It's probably missing a return value or something like that :O
Re: Script problem [need help its easy] -
xfelipex - 20.07.2010
Код:
if(strcmp("/repair",cmdtext, true, 10) == 0) {
new veh;
veh = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid)) {
RepairVehicle(GetPlayerVehicleID(playerid));
}
else {
SendClientMessage(playerid,Color,"vc nao esta num veiculo..");
}
return 1;
}
Re: Script problem [need help its easy] -
Last_Stand_Guardian - 20.07.2010
The code looks correct =D
So the problem must be somewhere else.
Try to use /* and */ to exclude this code, just to be sure that it's really the fault of that command.
Re: Script problem [need help its easy] -
Jochemd - 23.07.2010
I don't know if it could be a problem, but I post it anyway...
pawn Код:
if(strcmp("/repair",cmdtext, true, 10) == 0)
The '10' indicates the amount of tokens? Maybe it need to be changed to '7'. I hope that works