09.08.2009, 11:16
Hey,
I got the problem that a lot of the functions I make only work for the player with id 0.
Yesterday I finished my own pay 'n spray, I tested it and it worked fine (because I had id 0). but when a friend of mine joined the server the pay 'n spray didn't respond. This is the third time I come across this problem. Does anybody know what the solution is for this issue?
This is Part of the code:
This is the code for the menu (it's placed under OnGameModeInit):
This is the code for the menu function (I only copied case 1 because other cases are partly the same)
This is the playertopoint code (this is placed under my public custom pickups):
Thanks!
I got the problem that a lot of the functions I make only work for the player with id 0.
Yesterday I finished my own pay 'n spray, I tested it and it worked fine (because I had id 0). but when a friend of mine joined the server the pay 'n spray didn't respond. This is the third time I come across this problem. Does anybody know what the solution is for this issue?
This is Part of the code:
This is the code for the menu (it's placed under OnGameModeInit):
Код:
SetColor = CreateMenu("SetColor", 1, 50.0, 180.0, 200.0, 200.0); SetMenuColumnHeader(Navigation, 0, "Color1"); AddMenuItem(SetColor, 0, "Red"); AddMenuItem(SetColor, 0, "Blue"); AddMenuItem(SetColor, 0, "Green") AddMenuItem(SetColor, 0, "Yellow") AddMenuItem(SetColor, 0, "White") AddMenuItem(SetColor, 0, "Black") AddMenuItem(SetColor, 0, "Pink") AddMenuItem(SetColor, 0, "Grey") AddMenuItem(SetColor, 0, "Back")
Код:
if(current == SetColor) { switch(row) { case 0: { if (PlayerToPoint(2.0, playerid, 2703.0295,-2607.8708,13.3313)) { ChangeVehicleColor(mycar, 3, 1); SendClientMessage(playerid, COLOR_ORANGE, "The car is painted red."); HideMenuForPlayer(SetColor, playerid); TogglePlayerControllable(playerid, 1); SetVehiclePos(mycar, 2703.0295,-2607.8708,13.3313); PlayerPlaySound(playerid, 1134, 2703.0295,-2607.8708,13.3313); } else if (PlayerToPoint(2.0, playerid, 2703.0989,-2598.2961,13.3497)) { ChangeVehicleColor(mycar, 3, 1); SendClientMessage(playerid, COLOR_ORANGE, "The car is painted red."); HideMenuForPlayer(SetColor, playerid); TogglePlayerControllable(playerid, 1); SetVehiclePos(mycar, 2703.0989,-2598.2961,13.3497); PlayerPlaySound(playerid, 1134, 2703.0989,-2598.2961,13.3497); } } case 1: { if (PlayerToPoint(2.0, playerid, 2703.0295,-2607.8708,13.3313)) { ChangeVehicleColor(mycar, 79, 1); SendClientMessage(playerid, COLOR_ORANGE, "The car is painted blue."); HideMenuForPlayer(SetColor, playerid); TogglePlayerControllable(playerid, 1); SetVehiclePos(mycar, 2703.0295,-2607.8708,13.3313); PlayerPlaySound(playerid, 1134, 2703.0295,-2607.8708,13.3313); } else if (PlayerToPoint(2.0, playerid, 2703.0989,-2598.2961,13.3497)) { ChangeVehicleColor(mycar, 79, 1); SendClientMessage(playerid, COLOR_ORANGE, "The car is painted blue."); HideMenuForPlayer(SetColor, playerid); TogglePlayerControllable(playerid, 1); SetVehiclePos(mycar, 2703.0989,-2598.2961,13.3497); PlayerPlaySound(playerid, 1134, 2703.0989,-2598.2961,13.3497); } }
Код:
if (PlayerToPoint(2.0, playerid, 2697.7610,-2608.0239,13.6535)) {// Pay & Spray if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) { ShowMenuForPlayer(SetColor, playerid); TogglePlayerControllable(playerid, 0); SetVehiclePos(mycar, 2703.0295,-2607.8708,13.3313); } else { SendClientMessage(playerid, COLOR_WHITE, "This pay & spray is Only for yakuza members"); SendClientMessage(playerid, COLOR_WHITE, "Please try one of the regular pay & sprays"); } } if (PlayerToPoint(2.0, playerid, 2697.8784,-2598.3198,13.6725)) {// Pay & Spray if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) { ShowMenuForPlayer(SetColor, playerid); TogglePlayerControllable(playerid, 0); SetVehiclePos(mycar, 2703.0989,-2598.2961,13.3497); } else { SendClientMessage(playerid, COLOR_WHITE, "This pay & spray is Only for yakuza members"); SendClientMessage(playerid, COLOR_WHITE, "Please try one of the regular pay & sprays"); } }