Quick command help needed. [/fixveh] - 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: Quick command help needed. [/fixveh] (
/showthread.php?tid=213841)
Quick command help needed. [/fixveh] -
Kyle. - 20.01.2011
pawn Код:
if (strcmp("/fv", cmdtext, true, 10) == 0)
{
new VehicleID = GetPlayerVehicleID(playerid);
RepairVehicle(VehicleID);
SetVehicleHealth(VehicleID, 1000);
IsPlayerInVehicle(playerid, vehicleid);
SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: Your vehicle has been fully repaired.");
else SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: You must be in a vehicle to repair.");
return 1;
}
Код:
C:\Users\Kyle\Desktop\SAMP RP USE THIS!\gamemodes\testserver.pwn(274) : error 017: undefined symbol "vehicleid"
C:\Users\Kyle\Desktop\SAMP RP USE THIS!\gamemodes\testserver.pwn(276) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
What I want to do is to be able to have it so if you are in a vehicle it says "Your vehicle has been fully repaired" and if your not in a vehicle it says "You must be in a vehicle to repair. I want it to work for every vehicle, not just enter one vehicle ID.
Yes i'm noobish, this is my second day scripting.
Re: Quick command help needed. [/fixveh] -
iMonk3y - 20.01.2011
Monky fix, good now, happy be
pawn Код:
if (strcmp("/fv", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid,0x008080FF,"VEHICLE: Your vehicle has been fully repaired.");
}
else SendClientMessage(playerid,0x008080FF,"VEHICLE: You must be in a vehicle to repair.");
return 1;
}
Re: Quick command help needed. [/fixveh] -
Kyle. - 20.01.2011
Kyle use, works now, is happy!
Thanks alot.
Re: Quick command help needed. [/fixveh] -
MMiz - 20.01.2011
Код:
if (strcmp("/fv", cmdtext, true, 10) == 0)
{
new VehicleID = GetPlayerVehicleID(playerid);
RepairVehicle(VehicleID);
SetVehicleHealth(VehicleID, 1000);
IsPlayerInVehicle(playerid, vehicleid); // heres the error.
SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: Your vehicle has been fully repaired.");
else SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: You must be in a vehicle to repair.");
return 1;
}
Since Pawno is case-sensitive, you needed to type "VehicleID" because thats the one you defined, instead of vehicleid. Maybe that wasnt the only one error, im not on my laptop so i cant check