Bug /v park !
#1

I use this command

new vehid = GetPlayerVehicleID(playerid);
if(strcmp(cmd,"/v",true)==0)
{
// new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playernam e));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pCarKey]!=0)
{
format(string,sizeof(string),"________________%s__ ______________",CarInfo[CheckOwner(playerid)][cDescription]);
SendClientMessage(playerid, COLOR_GREEN,string);
SendClientMessage(playerid, COLOR_GRAD2,"** /v buy - Buys the car (if for sale)");
SendClientMessage(playerid, COLOR_GRAD2,"** /v sell - Sells the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v park - Park the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v exit - Exit the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v locate - Uses the car's On-Star to locate");
SendClientMessage(playerid, COLOR_GRAD2,"** /v lock - Locks the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v unlock - Unlocks the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v autolock - Automatically locks the car upon exiting");
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GRAD2,"** You do not currently own a car! **");
return 1;
}
}
return 1;
}
if(strcmp(tmp,"exit",true)==0)
{
CarOffered[playerid]=0;
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
if(strcmp(tmp, "buy", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
if(CarInfo[i][ownedvehicle] == vehid)
{
if(PlayerInfo[playerid][pCarKey]!=0)
{
SendClientMessage(playerid, COLOR_GREY, "You already own a car, type /v sell if you want to buy this one!");
return 1;
}
if(CarInfo[i][cOwned]==1)
{
SendClientMessage(playerid, COLOR_GREY, "Someone already owns this car");
return 1;
}
if(GetPlayerMoney(playerid) >= CarInfo[i][cValue])
{
PlayerInfo[playerid][pCarKey] = i;
CarInfo[i][cOwned] = 1;
CarOffered[playerid]=0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[i][cOwner], sendername, 0, strlen(sendername), 999);
GivePlayerMoney(playerid,-CarInfo[i][cValue]);
GameTextForPlayer(playerid, "~w~Congratulations~n~This is your car until you sell it!", 5000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
SendClientMessage(playerid, COLOR_GRAD2, "Type /v(ehicles) to view the car manual!");
TogglePlayerControllable(playerid, 1);
SaveCars();
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have the cash for that!");
return 1;
}
}
}
}
return 1;
}
if(strcmp(tmp, "sell", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pCarKey] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
return 1;
}
if(PlayerInfo[playerid][pCarKey] != 0 && strcmp(playername, CarInfo[PlayerInfo[playerid][pCarKey]][cOwner], true) == 0)
{
new car = PlayerInfo[playerid][pCarKey];
CarInfo[car][cOwned] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[car][cOwner], "Dealership", 0, strlen("Dealership"), 999);
GivePlayerMoney(playerid,CarInfo[car][cValue]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~You have sold your car for: ~n~~g~$%d", CarInfo[car][cValue]);
GameTextForPlayer(playerid, string, 10000, 3);
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
PlayerInfo[playerid][pCarKey] = 0;
return 1;
}
}
return 1;
}
if(strcmp(tmp,"park",true) == 0)
{
new Float,Float:y,Float:z;
new Float:a;
// new carid;
new getcarid;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey]) { carid = PlayerInfo[playerid][pCarKey]; }
else { return 1; }
getcarid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
GetVehiclePos(carid, x, y, z);
//GetPlayerFacingAngle(playerid, a);
GetVehicleZAngle(carid, a);
if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
{
if(PlayerInfo[playerid][pCarKey] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
return 1;
}
if(getcarid == carid)
{
CarInfo[carid][cLocationx] = x;
CarInfo[carid][cLocationy] = y;
CarInfo[carid][cLocationz] = z;
CarInfo[carid][cAngle] = a;
format(string, sizeof(string), "~n~ You have parked your vehicle in this location. ~n~");
GameTextForPlayer(playerid, "You have parked your vehicle in this position. It will respawn here.", 10000, 3);
DestroyVehicle(carid);
CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
TogglePlayerControllable(playerid, 1);
return 1;
}
}
}
if(strcmp(tmp, "locate", true) == 0)
{
if(!IsPlayerConnected(playerid)) { return 1; }
if(PlayerInfo[playerid][pCarKey] == 0) { GameTextForPlayer(playerid, "~w~You do not have a car to locate", 2500, 3); return 1; }
if(cartrack[playerid]==0)
{
SendClientMessage(playerid,COLOR_WHITE,"On-Star: This is On-Star's automated vehicle tracking system");
SendClientMessage(playerid,COLOR_WHITE,"On-Star: Please enter your PIN # and password now");
SendClientMessage(playerid,COLOR_WHITE,"On-Star: Your vehicle's location is now uploaded to your phone");
SetPlayerCheckpoint(playerid,CarInfo[PlayerInfo[playerid][pCarKey]][cLocationx], CarInfo[PlayerInfo[playerid][pCarKey]][cLocationy], CarInfo[PlayerInfo[playerid][pCarKey]][cLocationz], 5.0);
cartrack[playerid] = 1;
return 1;
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"On-Star: This is On-Star's automated vehicle tracking system");
SendClientMessage(playerid,COLOR_WHITE,"On-Star: The tracking on your vehicle has been canceled");
DisablePlayerCheckpoint(playerid);
cartrack[playerid] = 0;
return 1;
}
}
if(strcmp(tmp, "lock", true) == 0)
{
new keycar = PlayerInfo[playerid][pCarKey];
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,1);
}
format(string, sizeof(string), "~w~Car~n~~r~Locked");
GameTextForPlayer(playerid, string, 10000, 3);
CarInfo[keycar][cLock] = 1;
return 1;
}
}
if(strcmp(tmp, "unlock", true) == 0)
{
new keycar = PlayerInfo[playerid][pCarKey];
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,0);
}
format(string, sizeof(string), "~w~Car~n~~g~Unlocked");
GameTextForPlayer(playerid, string, 10000, 3);
CarInfo[keycar][cLock] = 0;
return 1;
}
}
if(strcmp(tmp, "autolock", true) == 0)
{
new keycar = PlayerInfo[playerid][pCarKey];
if(CarAutolock[CarInfo[keycar][ownedvehicle]] == 0) { CarAutolock[CarInfo[keycar][ownedvehicle]] = 1; format(string, sizeof(string), "~w~Car Autolock~n~~r~Engaged"); return 1; }
if(CarAutolock[CarInfo[keycar][ownedvehicle]] == 1) { CarAutolock[CarInfo[keycar][ownedvehicle]] = 0; format(string, sizeof(string), "~w~Car Autolock~n~~g~Disengaged"); return 1; }
GameTextForPlayer(playerid, string, 10000, 3);
return 1;
}
}
return 0;
}

and all orders go but / v park goes
Help me please!
Reply
#2

pawn Код:
new vehid = GetPlayerVehicleID(playerid);
if(strcmp(cmd,"/v",true)==0)
{
// new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playernam e));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pCarKey]!=0)
{
format(string,sizeof(string),"________________%s__ ______________",CarInfo[CheckOwner(playerid)][cDescription]);
SendClientMessage(playerid, COLOR_GREEN,string);
SendClientMessage(playerid, COLOR_GRAD2,"** /v buy - Buys the car (if for sale)");
SendClientMessage(playerid, COLOR_GRAD2,"** /v sell - Sells the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v park - Park the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v exit - Exit the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v locate - Uses the car's On-Star to locate");
SendClientMessage(playerid, COLOR_GRAD2,"** /v lock - Locks the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v unlock - Unlocks the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v autolock - Automatically locks the car upon exiting");
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GRAD2,"** You do not currently own a car! **");
return 1;
}
}
return 1;
}
if(strcmp(tmp,"exit",true)==0)
{
CarOffered[playerid]=0;
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
if(strcmp(tmp, "buy", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
if(CarInfo[i][ownedvehicle] == vehid)
{
if(PlayerInfo[playerid][pCarKey]!=0)
{
SendClientMessage(playerid, COLOR_GREY, "You already own a car, type /v sell if you want to buy this one!");
return 1;
}
if(CarInfo[i][cOwned]==1)
{
SendClientMessage(playerid, COLOR_GREY, "Someone already owns this car");
return 1;
}
if(GetPlayerMoney(playerid) >= CarInfo[i][cValue])
{
PlayerInfo[playerid][pCarKey] = i;
CarInfo[i][cOwned] = 1;
CarOffered[playerid]=0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[i][cOwner], sendername, 0, strlen(sendername), 999);
GivePlayerMoney(playerid,-CarInfo[i][cValue]);
GameTextForPlayer(playerid, "~w~Congratulations~n~This is your car until you sell it!", 5000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
SendClientMessage(playerid, COLOR_GRAD2, "Type /v(ehicles) to view the car manual!");
TogglePlayerControllable(playerid, 1);
SaveCars();
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have the cash for that!");
return 1;
}
}
}
}
return 1;
}
if(strcmp(tmp, "sell", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pCarKey] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
return 1;
}
if(PlayerInfo[playerid][pCarKey] != 0 && strcmp(playername, CarInfo[PlayerInfo[playerid][pCarKey]][cOwner], true) == 0)
{
new car = PlayerInfo[playerid][pCarKey];
CarInfo[car][cOwned] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[car][cOwner], "Dealership", 0, strlen("Dealership"), 999);
GivePlayerMoney(playerid,CarInfo[car][cValue]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~You have sold your car for: ~n~~g~$%d", CarInfo[car][cValue]);
GameTextForPlayer(playerid, string, 10000, 3);
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
PlayerInfo[playerid][pCarKey] = 0;
return 1;
}
}
return 1;
}
if(strcmp(tmp,"park",true) == 0)
{
new Float,Float:y,Float:z;
new Float:a;
// new carid;
new getcarid;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey]) { carid = PlayerInfo[playerid][pCarKey]; }
else { return 1; }
getcarid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
GetVehiclePos(carid, x, y, z);
//GetPlayerFacingAngle(playerid, a);
GetVehicleZAngle(carid, a);
if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
{
if(PlayerInfo[playerid][pCarKey] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
return 1;
}
if(getcarid == carid)
{
CarInfo[carid][cLocationx] = x;
CarInfo[carid][cLocationy] = y;
CarInfo[carid][cLocationz] = z;
CarInfo[carid][cAngle] = a;
format(string, sizeof(string), "~n~ You have parked your vehicle in this location. ~n~");
GameTextForPlayer(playerid, "You have parked your vehicle in this position. It will respawn here.", 10000, 3);
DestroyVehicle(carid);
CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
TogglePlayerControllable(playerid, 1);
return 1;
}
}
}
if(strcmp(tmp, "locate", true) == 0)
{
if(!IsPlayerConnected(playerid)) { return 1; }
if(PlayerInfo[playerid][pCarKey] == 0) { GameTextForPlayer(playerid, "~w~You do not have a car to locate", 2500, 3); return 1; }
if(cartrack[playerid]==0)
{
SendClientMessage(playerid,COLOR_WHITE,"On-Star: This is On-Star's automated vehicle tracking system");
SendClientMessage(playerid,COLOR_WHITE,"On-Star: Please enter your PIN # and password now");
SendClientMessage(playerid,COLOR_WHITE,"On-Star: Your vehicle's location is now uploaded to your phone");
SetPlayerCheckpoint(playerid,CarInfo[PlayerInfo[playerid][pCarKey]][cLocationx], CarInfo[PlayerInfo[playerid][pCarKey]][cLocationy], CarInfo[PlayerInfo[playerid][pCarKey]][cLocationz], 5.0);
cartrack[playerid] = 1;
return 1;
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"On-Star: This is On-Star's automated vehicle tracking system");
SendClientMessage(playerid,COLOR_WHITE,"On-Star: The tracking on your vehicle has been canceled");
DisablePlayerCheckpoint(playerid);
cartrack[playerid] = 0;
return 1;
}
}
if(strcmp(tmp, "lock", true) == 0)
{
new keycar = PlayerInfo[playerid][pCarKey];
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,1);
}
format(string, sizeof(string), "~w~Car~n~~r~Locked");
GameTextForPlayer(playerid, string, 10000, 3);
CarInfo[keycar][cLock] = 1;
return 1;
}
}
if(strcmp(tmp, "unlock", true) == 0)
{
new keycar = PlayerInfo[playerid][pCarKey];
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,0);
}
format(string, sizeof(string), "~w~Car~n~~g~Unlocked");
GameTextForPlayer(playerid, string, 10000, 3);
CarInfo[keycar][cLock] = 0;
return 1;
}
}
if(strcmp(tmp, "autolock", true) == 0)
{
new keycar = PlayerInfo[playerid][pCarKey];
if(CarAutolock[CarInfo[keycar][ownedvehicle]] == 0) { CarAutolock[CarInfo[keycar][ownedvehicle]] = 1; format(string, sizeof(string), "~w~Car Autolock~n~~r~Engaged"); return 1; }
if(CarAutolock[CarInfo[keycar][ownedvehicle]] == 1) { CarAutolock[CarInfo[keycar][ownedvehicle]] = 0; format(string, sizeof(string), "~w~Car Autolock~n~~g~Disengaged"); return 1; }
GameTextForPlayer(playerid, string, 10000, 3);
return 1;
}
}
return 0;
}
And what is the bugg?

this fix
pawn Код:
// new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playernam e));
to
pawn Код:
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
Reply
#3

Quote:
Originally Posted by Scrip
Посмотреть сообщение
pawn Код:
new vehid = GetPlayerVehicleID(playerid);
if(strcmp(cmd,"/v",true)==0)
{
// new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playernam e));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pCarKey]!=0)
{
format(string,sizeof(string),"________________%s__ ______________",CarInfo[CheckOwner(playerid)][cDescription]);
SendClientMessage(playerid, COLOR_GREEN,string);
SendClientMessage(playerid, COLOR_GRAD2,"** /v buy - Buys the car (if for sale)");
SendClientMessage(playerid, COLOR_GRAD2,"** /v sell - Sells the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v park - Park the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v exit - Exit the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v locate - Uses the car's On-Star to locate");
SendClientMessage(playerid, COLOR_GRAD2,"** /v lock - Locks the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v unlock - Unlocks the car");
SendClientMessage(playerid, COLOR_GRAD2,"** /v autolock - Automatically locks the car upon exiting");
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GRAD2,"** You do not currently own a car! **");
return 1;
}
}
return 1;
}
if(strcmp(tmp,"exit",true)==0)
{
CarOffered[playerid]=0;
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
if(strcmp(tmp, "buy", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
if(CarInfo[i][ownedvehicle] == vehid)
{
if(PlayerInfo[playerid][pCarKey]!=0)
{
SendClientMessage(playerid, COLOR_GREY, "You already own a car, type /v sell if you want to buy this one!");
return 1;
}
if(CarInfo[i][cOwned]==1)
{
SendClientMessage(playerid, COLOR_GREY, "Someone already owns this car");
return 1;
}
if(GetPlayerMoney(playerid) >= CarInfo[i][cValue])
{
PlayerInfo[playerid][pCarKey] = i;
CarInfo[i][cOwned] = 1;
CarOffered[playerid]=0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[i][cOwner], sendername, 0, strlen(sendername), 999);
GivePlayerMoney(playerid,-CarInfo[i][cValue]);
GameTextForPlayer(playerid, "~w~Congratulations~n~This is your car until you sell it!", 5000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
SendClientMessage(playerid, COLOR_GRAD2, "Type /v(ehicles) to view the car manual!");
TogglePlayerControllable(playerid, 1);
SaveCars();
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have the cash for that!");
return 1;
}
}
}
}
return 1;
}
if(strcmp(tmp, "sell", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pCarKey] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
return 1;
}
if(PlayerInfo[playerid][pCarKey] != 0 && strcmp(playername, CarInfo[PlayerInfo[playerid][pCarKey]][cOwner], true) == 0)
{
new car = PlayerInfo[playerid][pCarKey];
CarInfo[car][cOwned] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[car][cOwner], "Dealership", 0, strlen("Dealership"), 999);
GivePlayerMoney(playerid,CarInfo[car][cValue]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~You have sold your car for: ~n~~g~$%d", CarInfo[car][cValue]);
GameTextForPlayer(playerid, string, 10000, 3);
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
PlayerInfo[playerid][pCarKey] = 0;
return 1;
}
}
return 1;
}
if(strcmp(tmp,"park",true) == 0)
{
new Float,Float:y,Float:z;
new Float:a;
// new carid;
new getcarid;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey]) { carid = PlayerInfo[playerid][pCarKey]; }
else { return 1; }
getcarid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
GetVehiclePos(carid, x, y, z);
//GetPlayerFacingAngle(playerid, a);
GetVehicleZAngle(carid, a);
if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
{
if(PlayerInfo[playerid][pCarKey] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
return 1;
}
if(getcarid == carid)
{
CarInfo[carid][cLocationx] = x;
CarInfo[carid][cLocationy] = y;
CarInfo[carid][cLocationz] = z;
CarInfo[carid][cAngle] = a;
format(string, sizeof(string), "~n~ You have parked your vehicle in this location. ~n~");
GameTextForPlayer(playerid, "You have parked your vehicle in this position. It will respawn here.", 10000, 3);
DestroyVehicle(carid);
CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
TogglePlayerControllable(playerid, 1);
return 1;
}
}
}
if(strcmp(tmp, "locate", true) == 0)
{
if(!IsPlayerConnected(playerid)) { return 1; }
if(PlayerInfo[playerid][pCarKey] == 0) { GameTextForPlayer(playerid, "~w~You do not have a car to locate", 2500, 3); return 1; }
if(cartrack[playerid]==0)
{
SendClientMessage(playerid,COLOR_WHITE,"On-Star: This is On-Star's automated vehicle tracking system");
SendClientMessage(playerid,COLOR_WHITE,"On-Star: Please enter your PIN # and password now");
SendClientMessage(playerid,COLOR_WHITE,"On-Star: Your vehicle's location is now uploaded to your phone");
SetPlayerCheckpoint(playerid,CarInfo[PlayerInfo[playerid][pCarKey]][cLocationx], CarInfo[PlayerInfo[playerid][pCarKey]][cLocationy], CarInfo[PlayerInfo[playerid][pCarKey]][cLocationz], 5.0);
cartrack[playerid] = 1;
return 1;
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"On-Star: This is On-Star's automated vehicle tracking system");
SendClientMessage(playerid,COLOR_WHITE,"On-Star: The tracking on your vehicle has been canceled");
DisablePlayerCheckpoint(playerid);
cartrack[playerid] = 0;
return 1;
}
}
if(strcmp(tmp, "lock", true) == 0)
{
new keycar = PlayerInfo[playerid][pCarKey];
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,1);
}
format(string, sizeof(string), "~w~Car~n~~r~Locked");
GameTextForPlayer(playerid, string, 10000, 3);
CarInfo[keycar][cLock] = 1;
return 1;
}
}
if(strcmp(tmp, "unlock", true) == 0)
{
new keycar = PlayerInfo[playerid][pCarKey];
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,0);
}
format(string, sizeof(string), "~w~Car~n~~g~Unlocked");
GameTextForPlayer(playerid, string, 10000, 3);
CarInfo[keycar][cLock] = 0;
return 1;
}
}
if(strcmp(tmp, "autolock", true) == 0)
{
new keycar = PlayerInfo[playerid][pCarKey];
if(CarAutolock[CarInfo[keycar][ownedvehicle]] == 0) { CarAutolock[CarInfo[keycar][ownedvehicle]] = 1; format(string, sizeof(string), "~w~Car Autolock~n~~r~Engaged"); return 1; }
if(CarAutolock[CarInfo[keycar][ownedvehicle]] == 1) { CarAutolock[CarInfo[keycar][ownedvehicle]] = 0; format(string, sizeof(string), "~w~Car Autolock~n~~g~Disengaged"); return 1; }
GameTextForPlayer(playerid, string, 10000, 3);
return 1;
}
}
return 0;
}
And what is the bugg?

this fix
pawn Код:
// new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playernam e));
to
pawn Код:
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
I did this just goes park
Reply
#4

I forgot to mention: the fs going all but goes gm / v park Please help me
Reply
#5

I cant understand what the problem is, Can you explain?
Reply
#6

pawn Код:
else if(strcmp(x_nr,"park",true) == 0)
            {
                new Float:x,Float:y,Float:z;
                new Float:a;
                new carid;
                new getcarid;
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; }
                else { return 1; }
                getcarid = GetPlayerVehicleID(playerid);
                GetPlayerName(playerid, playername, sizeof(playername));
                GetVehiclePos(carid, x, y, z);
                //GetPlayerFacingAngle(playerid, a);
                GetVehicleZAngle(carid, a);
                if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
                {
                    if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 && PlayerInfo[playerid][pPcarkey3])
                    {
                        SendClientMessage(playerid, COLOR_GREY, "You donґt have car.");
                        return 1;
                    }
                    if(getcarid == carid)
                    {
                        CarInfo[carid][cLocationx] = x;
                        CarInfo[carid][cLocationy] = y;
                        CarInfo[carid][cLocationz] = z;
                        CarInfo[carid][cAngle] = a;
                        format(string, sizeof(string), "~n~ You have park you car here. ~n~");
                        GameTextForPlayer(playerid, "You car his here is spaew here.", 10000, 3);
                        OnPropUpdate();
                        OnPlayerUpdate(playerid);
                        DestroyVehicle(carid);
                        CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
                        TogglePlayerControllable(playerid, 1);
                        return 1;
                    }
                }
            }
Reply
#7

Quote:
Originally Posted by Scrip
Посмотреть сообщение
pawn Код:
else if(strcmp(x_nr,"park",true) == 0)
            {
                new Float:x,Float:y,Float:z;
                new Float:a;
                new carid;
                new getcarid;
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; }
                else { return 1; }
                getcarid = GetPlayerVehicleID(playerid);
                GetPlayerName(playerid, playername, sizeof(playername));
                GetVehiclePos(carid, x, y, z);
                //GetPlayerFacingAngle(playerid, a);
                GetVehicleZAngle(carid, a);
                if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
                {
                    if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 && PlayerInfo[playerid][pPcarkey3])
                    {
                        SendClientMessage(playerid, COLOR_GREY, "You donґt have car.");
                        return 1;
                    }
                    if(getcarid == carid)
                    {
                        CarInfo[carid][cLocationx] = x;
                        CarInfo[carid][cLocationy] = y;
                        CarInfo[carid][cLocationz] = z;
                        CarInfo[carid][cAngle] = a;
                        format(string, sizeof(string), "~n~ You have park you car here. ~n~");
                        GameTextForPlayer(playerid, "You car his here is spaew here.", 10000, 3);
                        OnPropUpdate();
                        OnPlayerUpdate(playerid);
                        DestroyVehicle(carid);
                        CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
                        TogglePlayerControllable(playerid, 1);
                        return 1;
                    }
                }
            }
There goes any way: | What does it take? filterscript goes in but does not go gm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)