14.02.2013, 10:46
Quote:
assuming you already prepared your script for holding some variables, like
Код:
new PlantObject[MAX_PLAYERS][5];//5 plants per player new PlantPosition[MAX_PLAYERS][5][4];//0,1 and 2= position, 3=rotation(angle) new PlantGrams[MAX_PLAYERS][5];//not to forget the growed stuff i would start with a simple command to plant a seed: Код:
CMD:plant(playerid,params[]){ SendClientMessage(playerid,-1,"plant command working"); for(new p=0;p<5;p++) { if(PlantObject[playerid][p]==0) { new Float:pX,Float:pY,Float:pZ,Float:pA; GetPlayerPos(playerid,pX,pY,pZ); GetPlayerFacingangle(playerid,pA); PlantObject[playerid][p]=CreateObject(...,pX,pY,pZ,pA); PlantPosition[playerid][0]=pX; PlantPosition[playerid][1]=pY; PlantPosition[playerid][2]=pZ; PlantPosition[playerid][3]=pA; } } return 1; } ![]() anyways, when you think about any limitations like "5 plants per player", its a good idea to prepare for scripting an "endless plants as much the streamer can process". each plant can be planted by ONE player - pretty obvious. why assign each plant to a player (that [5] limitation), when you can rather assign a player to each plant? Код:
const PlantsMax=20000; PlantedByPlayerID[MAX_PLANTS]=playerid; you got the idea? good. now youll be busy hehe |
You explained pretty well, and thanks!