08.06.2010, 21:38
Код:
Se eu nгo me engano para frente й o X entгo tu faz tipo assim... new Float:X, Float:Y, Float:Z; GetPlayerPos(plid,X,Y,Z); SetPlayerPos(plid, X+20, Y, Z); 20 = Distвncia que ele ia para frente, se nгo for no X tenta no Y o Z nгo й й altura.. Esse mйtodo dб para fazer o /tapa tб ligado.... Dъvidas sу perguntar, se nгo conseguir fazer eu faзo para tu.
Код:
strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; } public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256]; cmd = strtok(cmdtext, idx); if(!strcmp(cmd, "/correr", true)) if(IsPlayerAdmin(playerid)){ new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFAA, "USE: /correr [id]."); return 1; } new plid; plid = strval(tmp); new Float:X, Float:Y, Float:Z; GetPlayerPos(plid,X,Y,Z); SetPlayerPos(plid, X+10, Y, Z); return 1; } else{ SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo tem permissгo!"); return 1; }