teleport & carspawn - 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: teleport & carspawn (
/showthread.php?tid=87238)
teleport & carspawn -
[SOB]Chris - 19.07.2009
i want do that but the pawno say this error
maps.pwn(329) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
maps.pwn(334) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
maps.pwn(690) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
maps.pwn(695) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
on thop of the script
public OnPlayerCommandText(playerid, cmdtext[])
Код:
if (strcmp("/chocones", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,-2059.9880,-211.7617,56.3695);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
new Float:X,Float:Y,Float:Z, Float:Angle; GetPlayerPos(playerid, X,Y,Z);
SendClientMessage(playerid,0x99ccff,"Mapa por [SOB]Chris");
if (vehicleid==0)
{
vehicleid=CreateVehicle(539,X,Y,Z,Angle,6,0,-1);
PutPlayerInVehicle(playerid,vehicleid,0);
}
else
{
DestroyVehicle(vehicleid);
vehicleid=CreateVehicle(539,X,Y,Z,Angle,6,0,-1);
PutPlayerInVehicle(playerid,vehicleid,0);
}
return 1;
}
what supose do the script, teleport player to place spawn a car and put the player in the car, if a car already exist destroy the car and spawn a new.
=S im bad xD
Re: teleport & carspawn -
Khelif - 19.07.2009
those are only warnings, delete all lines where you get warning and problem should be fixed
Re: teleport & carspawn -
ғαιιοцт - 19.07.2009
Quote:
Originally Posted by ĸнelιғaтι
those are only warnings, delete all lines where you get warning and problem should be fixed
|
deleting is the worst he can do
just rename new vehicleid=0; to something else (example: new VehID=0)
the errors means you have more than 1 variables with the same name.
Re: teleport & carspawn -
kc - 19.07.2009
Quote:
Originally Posted by ĸнelιғaтι
those are only warnings, delete all lines where you get warning and problem should be fixed
|
[me=kc]sighs...[/me]
In case you haven't guessed, [SOB]Chris please don't listen to ĸнelιғaтι.
The error is pretty self explanatory really, it means that you have defined 2 variables of the same name in overlapping scopes.
To fix it, you simply need to rename vehicleid in one of the instances.