07.11.2014, 19:37
Hey all
I can't work with trucker job on my server
http://postimg.org/gallery/e3ysy068/04f693aa/
I can't work with trucker job on my server
http://postimg.org/gallery/e3ysy068/04f693aa/
Код:
if(strcmp(cmd, "/load", true) == 0) { if(IsPlayerConnected(playerid)) { new tmpcar = GetPlayerVehicleID(playerid); if(!IsATruck(tmpcar)) { GameTextForPlayer(playerid, "~r~You are not in a delivery truck", 5000, 1); return 1; } format(string, sizeof(string), "Products: %d.", PlayerInfo[playerid][pTruckLoad]); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); } return 1; } if(strcmp(cmd, "/buyprods", true) == 0) { if(IsPlayerConnected(playerid)) { new tmpcar = GetPlayerVehicleID(playerid); if(PlayerToPoint(70.0, playerid, 2468.4919,-2092.9902,13.5469)) { if(IsATruck(tmpcar)) { if(PlayerInfo[playerid][pTruckLoad] < 200) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /buyprods [1-200]"); return 1; } new amount = strval(tmp); if(amount < 1 || amount > 200) { SendClientMessage(playerid, COLOR_GREY, " Can't buy less then 1 Product or more then 200 !"); return 1; } new cost = amount*50; if(GetPlayerMoney(playerid) > cost) { PlayerInfo[playerid][pTruckLoad] += amount; format(string, sizeof(string), "You bought %d Products for $%d.", amount,cost); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); SafeGivePlayerMoney(playerid,-cost); return 1; } else { format(string, sizeof(string), "You cant afford %d Products at $%d !", amount,cost); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); return 1; } } else { SendClientMessage(playerid, TEAM_GROVE_COLOR, "You cannot carry more then 200 products at a time"); return 1; } } else { SendClientMessage(playerid, TEAM_GROVE_COLOR, "This Vehicle does not deliver Products."); return 1; } } } return 1; } if(strcmp(cmd, "/sellprods", true) == 0) { new cashmade; new tmpcar; if(IsPlayerConnected(playerid)) { tmpcar = GetPlayerVehicleID(playerid); if(!IsATruck(tmpcar)) { GameTextForPlayer(playerid, "~r~You are not in a delivery truck", 5000, 1); return 1; } if(PlayerInfo[playerid][pTruckLoad] == 0) { GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1); format(string, sizeof(string), "Products: %d.", PlayerInfo[playerid][pTruckLoad]); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); return 1; } for(new i = 0; i < sizeof(BizzInfo); i++) { if (IsPlayerInRangeOfPoint(playerid, 10,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ])) { //printf("Found House :%d",i); for(new l = PlayerInfo[playerid][pTruckLoad]; l > 0; l--) { if(BizzInfo[i][bProducts] == BizzInfo[i][bMaxProducts]) { GameTextForPlayer(playerid, "~r~Our stores are full", 5000, 1); format(string, sizeof(string), "Cash Earned $%d.", cashmade); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); format(string, sizeof(string), "Products: %d.", PlayerInfo[playerid][pTruckLoad]); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); return 1; } if(BizzInfo[i][bPriceProd] > BizzInfo[i][bTill]) { GameTextForPlayer(playerid, "~r~We Cant Afford The Deal", 5000, 1); format(string, sizeof(string), "Cash Earned $%d.", cashmade); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); format(string, sizeof(string), "Products: %d.", PlayerInfo[playerid][pTruckLoad]); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); return 1; }