Hi all wieder ich ^^,
Hab mir was vom GF abgeguckt und dann ist das entstanden
dcmd_ausschenken(playerid, params[])
{
new id, drink;
new x_drink[256];
x_drink = strtok(params, drink);
if (!sscanf(params, "ds", id, drink)) SendClientMessage(playerid, 0xFF0000FF, "[INFO] Usage: /auschenken [ID] [Getränk]");
else if (!strlen(x_drink)) SendClientMessage(playerid, 0xFF0000FF, "[INFO] Tippe /drinkliste um die Getränke aufzulisten.");
else if (!IsPlayerConnected(id)) SendClientMessage(playerid, 0xFF0000FF, "[INFO] Invalid ID");
else if (PInfo[playerid][Job] != 8) SendClientMessage(playerid, 0xFF0000FF, "[INFO] Du bist kein Angestellter");
else if (IsPlayerConnected(id))
{
if(strcmp(x_drink,"Vodka",true) == 0)
{
new tmp[256], tmp2[256];
format(tmp,256,"[Pinky's Bar] %s schenkt %s einen Glas %s aus!",PlayerName(playerid),PlayerName(id), drink);
SendClientMessageForTeam(3,COLOR_BLUE,tmp); //TO CORRECT TEAM :)
format(tmp2,256,"[Pinky's Bar] Hier ist euer Glas %s Sir",PlayerName(playerid),PlayerName(id), drink);
SendClientMessage(id,0x00FF00FF,tmp2);
}
else if(strcmp(x_drink,"Bier",true) == 0)
{
new tmp[256], tmp2[256];
format(tmp,256,"[Pinky's Bar] %s schenkt %s einen Glas %s aus",PlayerName(playerid),PlayerName(id), drink);
SendClientMessageForTeam(3,COLOR_BLUE,tmp); //TO CORRECT TEAM :)
format(tmp2,256,"[Pinky's Bar] Hier ist euer Glas %s Sir",PlayerName(playerid),PlayerName(id), drink);
SendClientMessage(id,0x00FF00FF,tmp2);
}
else if(strcmp(x_drink,"Schnapps",true) == 0)
{
new tmp[256], tmp2[256];
format(tmp,256,"[Pinky's Bar] %s schenkt %s einen Glas %s aus!",PlayerName(playerid),PlayerName(id), drink);
SendClientMessageForTeam(3,COLOR_BLUE,tmp); //TO CORRECT TEAM :)
format(tmp2,256,"[Pinky's Bar] Hier ist euer Glas %s Sir",PlayerName(playerid),PlayerName(id), drink);
SendClientMessage(id,0x00FF00FF,tmp2);
}
else if(strcmp(x_drink,"Koktail",true) == 0)
{
new tmp[256], tmp2[256];
format(tmp,256,"[Pinky's Bar] %s schenkt %s einen Glas %s aus!",PlayerName(playerid),PlayerName(id), drink);
SendClientMessageForTeam(3,COLOR_BLUE,tmp); //TO CORRECT TEAM :)
format(tmp2,256,"[Pinky's Bar] Hier ist euere %s Sir",PlayerName(playerid),PlayerName(id), drink);
SendClientMessage(id,0x00FF00FF,tmp2);
}
else if(strcmp(x_drink,"Orangensaft",true) == 0)
{
new tmp[256], tmp2[256];
format(tmp,256,"[Pinky's Bar] %s schenkt %s einen Glas %s aus!",PlayerName(playerid),PlayerName(id), drink);
SendClientMessageForTeam(3,COLOR_BLUE,tmp); //TO CORRECT TEAM :)
format(tmp2,256,"[Pinky's Bar] Hier ist euer Glas %s Sir",PlayerName(playerid),PlayerName(id), drink);
SendClientMessage(id,0x00FF00FF,tmp2);
}
else if(strcmp(x_drink,"Cola",true) == 0)
{
new tmp[256], tmp2[256];
format(tmp,256,"[Pinky's Bar] %s schenkt %s einen Glas %s aus!",PlayerName(playerid),PlayerName(id), drink);
SendClientMessageForTeam(3,COLOR_BLUE,tmp); //TO CORRECT TEAM :)
format(tmp2,256,"[Pinky's Bar] Hier ist euer Glas %s Sir",PlayerName(playerid),PlayerName(id), drink);
SendClientMessage(id,0x00FF00FF,tmp2);
}
else if(strcmp(x_drink,"Wasser",true) == 0)
{
new tmp[256], tmp2[256];
format(tmp,256,"[Pinky's Bar] %s schenkt %s einen Glas %s aus!",PlayerName(playerid),PlayerName(id), drink);
SendClientMessageForTeam(3,COLOR_BLUE,tmp); //TO CORRECT TEAM :)
format(tmp2,256,"[Pinky's Bar] Hier ist euer Glas %s Sir",PlayerName(playerid),PlayerName(id), drink);
SendClientMessage(id,0x00FF00FF,tmp2);
}
else if(strcmp(x_drink,"Wein",true) == 0)
{
new tmp[256], tmp2[256];
format(tmp,256,"[Pinky's Bar] %s gibt %s eine Flasche %s!",PlayerName(playerid),PlayerName(id), drink);
SendClientMessageForTeam(3,COLOR_BLUE,tmp); //TO CORRECT TEAM :)
format(tmp2,256,"[Pinky's Bar] Hier ist euere Flasche %s Sir",PlayerName(playerid),PlayerName(id), drink);
SendClientMessage(id,0x00FF00FF,tmp2);
}
else if(strcmp(x_drink,"Champagne",true) == 0)
{
new tmp[256], tmp2[256];
format(tmp,256,"[Pinky's Bar] %s gibt %s eine Flasche %s!",PlayerName(playerid),PlayerName(id), drink);
SendClientMessageForTeam(3,COLOR_BLUE,tmp); //TO CORRECT TEAM :)
format(tmp2,256,"[Pinky's Bar] Hier ist euere Flasche %s Sir",PlayerName(playerid),PlayerName(id), drink);
SendClientMessage(id,0x00FF00FF,tmp2);
}
}
return 1;
}
0 erros/warnings
Doch wenn ich zB /ausschenken 1 Vodka mache crasht mein server und startet wieder neu, hätte jemand ne Idee woran das liegen kann ?
MfG Sn1p3r