Info loads into another enum - 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)
+--- Thread: Info loads into another enum (
/showthread.php?tid=620835)
Info loads into another enum -
justjamie - 03.11.2016
Hello,
when i run this code, the info goes in another enum and overwrites.
PHP код:
else if(!strcmp(tmp, "factionize", true, 9))
{
new query[200];
new vehicleid = GetPlayerNearestVehicle(playerid);
new factionid = strlen(tmp2);
if(GetDistanceFromPlayerToVehicle(playerid, vehicleid) > 5.0)
return SendClientError(playerid, "There is no vehicle around you!");
if(!strlen(tmp2)) return SendClientUsage(playerid, "/av factionize [FactionID]");
format(query,sizeof(query),"UPDATE vehicles SET vOwner='%s',vFaction='%i' WHERE id='%i'",Faction1337[factionid][factionName],factionid,vehicleid);
mysql_tquery(connection,query,"");
myStrcpy(Vehicle[vehicleid][vOwner], Faction1337[factionid][factionName]);
Vehicle[vehicleid][vFaction] = factionid;
SendStaffMessage(playerid,sprintf("This %s has been factionized for faction %s",GetVehicleName(vehicleid),Faction1337[factionid][factionName]));
}
When i remove this:
PHP код:
myStrcpy(Vehicle[vehicleid][vOwner], Faction1337[factionid][factionName]);
Then it doesn't occur anymore.
What did i do wrong here?
Re: Info loads into another enum -
justjamie - 06.11.2016
bumperinos