[AJUDA]Comando /v -
ecl - 12.12.2010
Eu vi vбrios servers gringos com o comando /v que voce digita /v Id do veнculo/parte do nome/nome e voce ja sai dirigindo.
Mas nгo sei o script.
Da uma forзa ae.
Re: [AJUDA]Comando /v -
[Ips]Guh - 12.12.2010
Tem um Fs que vi na net desse jeito ae,aki no forum tbm tem,Pesquisa la nos lanзamentos : spawn
tem um la do tiagoPs....
Re: [AJUDA]Comando /v -
Katros - 12.12.2010
Tem um que vocк usa a Rcon pra dar spawn, deve tar no forum!
Re: [AJUDA]Comando /v -
Macintosh - 12.12.2010
Adapta o /veh [нd] [cor] do TLC.
Re: [AJUDA]Comando /v - rjjj - 12.12.2010
Montei o cуdigo pra vocк:
pawn Код:
if(strcmp("/v", cmdtext, true, 1) == 0)
{
if(IsPlayerConnected(playerid))
{
new idx;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFFFFFFAA, "Digite: /v [id do veнculo]");
return 1;
}
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new vehid = CreateVehicle(strval(tmp), X,Y,Z, 0.0, 3, 3, 60000);
PutPlayerInVehicle(playerid, vehid, 0);
SendClientMessage(playerid, 0xFFFFFFAA, "Vocк criou um carro :O !");
}
return 1;
}
Se der erro a respeito de "strtok" adicione no final do GameMode:
pawn Код:
stock 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;
}
Espero ter ajudado
Re: [AJUDA]Comando /v -
ecl - 13.12.2010
Quote:
Originally Posted by rjjj
Montei o cуdigo pra vocк:
pawn Код:
if(strcmp("/v", cmdtext, true, 1) == 0) { if(IsPlayerConnected(playerid)) { new idx; new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFAA, "Digite: /v [id do veнculo]"); return 1; } new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z); new vehid = CreateVehicle(strval(tmp), X,Y,Z, 0.0, 3, 3, 60000); PutPlayerInVehicle(playerid, vehid, 0); SendClientMessage(playerid, 0xFFFFFFAA, "Vocк criou um carro :O !"); } return 1; }
Se der erro a respeito de "strtok" adicione no final do GameMode:
pawn Код:
stock 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; }
Espero ter ajudado 
|
Certo Obrigado ajudou e muito eu sofri para acha o FS ou script vlw.

Estou montando um GM por isso tava precisando deste comando ele tbm da certo com parte do nome do veнculo ou nome do veiculo?
Se der beleza, agora se nao der vou ter que alterar algumas coisas posso?
Re: [AJUDA]Comando /v -
TiagoPS - 13.12.2010
pawn Код:
if(strcmp(cmd, "/veiculo", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid, 0xFF0000AA, "USO: /veiculo [ID] [COR 1] [COR 2]");
}
new ID;
ID = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid, 0xFF0000AA, "USO: /veiculo [ID] [COR 1] [COR 2]");
}
new Cor1;
Cor1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid, 0xFF0000AA, "USO: /veiculo [ID] [COR 1] [COR 2]");
}
new Cor2;
Cor2 = strval(tmp);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
CreateVehicle(ID, X+2, Y, Z, 0.0, Cor1, Cor2, 60000);
return SendClientMessage(playerid,0x00FF00AA,"Veiculo Criado");
}
O meu tambйm й bonito hehe
/Veiculo [ID] [COR1] [COR2]
Re: [AJUDA]Comando /v -
ecl - 13.12.2010
Quote:
Originally Posted by rjjj
Montei o cуdigo pra vocк:
pawn Код:
if(strcmp("/v", cmdtext, true, 1) == 0) { if(IsPlayerConnected(playerid)) { new idx; new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFAA, "Digite: /v [id do veнculo]"); return 1; } new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z); new vehid = CreateVehicle(strval(tmp), X,Y,Z, 0.0, 3, 3, 60000); PutPlayerInVehicle(playerid, vehid, 0); SendClientMessage(playerid, 0xFFFFFFAA, "Vocк criou um carro :O !"); } return 1; }
Se der erro a respeito de "strtok" adicione no final do GameMode:
pawn Код:
stock 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; }
Espero ter ajudado 
|
Ae Rjjj deu erro na 'strtok' eu nao entendo muito bem ainda de pawn

, estou estudando, e nao consegui resolver esse problema, da uma olhada:
pawn Код:
C:\server\filterscripts\DM.pwn(88) : warning 217: loose indentation
C:\server\filterscripts\DM.pwn(115) : warning 217: loose indentation
C:\server\filterscripts\DM.pwn(136) : error 029: invalid expression, assumed zero
C:\server\filterscripts\DM.pwn(136) : error 017: undefined symbol "string"
C:\server\filterscripts\DM.pwn(136) : error 017: undefined symbol "index"
C:\server\filterscripts\DM.pwn(136) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
Nгo consegui consertar.
Re: [AJUDA]Comando /v -
Pierox_ - 13.12.2010
Final do gm ,
Код:
stock 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;
}